code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0137,
0.0009,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0156,
0.0009,
0,
0.66,
0.0278,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0174,
0.0009,
0,
0.66,... | [
"\"\"\"Implement resource abstraction for Course-level items.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import cgi",
"import yaml",
"import models",
"import courses",
"import messages",
"from common import resource",
"from common import safe_dom",
"from common import schema_field... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0216,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0245,
0.0014,
0,
0.66,
0.025,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0274,
0.0014,
0,
0.66,
... | [
"\"\"\"Set of converters between db models, Python and JSON dictionaries, etc.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import datetime",
"import itertools",
"import json",
"from StringIO import StringIO",
"import types",
"import urlparse",
"from xml.etree import ElementTree",
... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0711,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0806,
0.0047,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.09,
0.0047,
0,
0.66,
... | [
"\"\"\"Manages mapping of users to roles and roles to privileges.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import collections",
"import config",
"from common import utils",
"from models import MemcacheManager",
"from models import RoleDAO",
"from google.appengine.api import users... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0212,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.024,
0.0014,
0,
0.66,
0.0263,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0283,
0.0014,
0,
0.66,
... | [
"\"\"\"Common classes and methods for processing text content.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"from pyparsing import alphas",
"from pyparsing import Combine",
"from pyparsing import Each",
"from pyparsing import Group",
"from pyparsing import Literal",
"from pyparsing im... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1145,
0.0076,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.1527,
0.0382,
0,
0.66,
0.2,
451,
0,
1,
0,
0,
186,
0,
1
],
[
8,
1,
0.145,
0.0076,
1,
0.73,
... | [
"\"\"\"Core service interface definitions.\"\"\"",
"class Service(object):\n \"\"\"Abstract base service interface.\"\"\"\n\n def enabled(self):\n raise NotImplementedError()",
" \"\"\"Abstract base service interface.\"\"\"",
" def enabled(self):\n raise NotImplementedError()",
"cl... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0542,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0668,
0.0144,
0,
0.66,
0.1,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0794,
0.0036,
0,
0.66,
... | [
"\"\"\"Models and helper utilities for the review workflow.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n 'sll@google.com (Sean Lip)',\n]",
"import entities",
"import transforms",
"import models",
"from google.appengine.ext import db",
"class KeyProperty(db.StringProperty):\n \"\... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1327,
0.0088,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1504,
0.0088,
0,
0.66,
0.0417,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1681,
0.0088,
0,
0.66,... | [
"\"\"\"Messages used in the models.\"\"\"",
"__author__ = 'Boris Roussev (borislavr@google.com)'",
"from common import safe_dom",
"PEER_MATCHER_NAME = 'Peer'",
"ASSESSMENT_CONTENT_DESCRIPTION = safe_dom.assemble_text_message(\"\"\"\nAssessment questions and answers (JavaScript format).\n\"\"\", 'https://cod... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.7895,
0.0526,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8947,
0.0526,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
0.0526,
0,
0.66,
1,... | [
"\"\"\"Constants shared between transforms.py and entity_transforms.py.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"SIMPLE_TYPES = (int, long, float, bool, dict, basestring, list)"
] |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0538,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0609,
0.0036,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0681,
0.0036,
0,
0.66,... | [
"\"\"\"Common classes and methods for managing persistent entities.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"from counters import PerfCounter",
"import transforms",
"from google.appengine.ext import db",
"DB_QUERY = PerfCounter(\n 'gcb-models-db-query',\n 'A number of times a q... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1786,
0.0119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2024,
0.0119,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.25,
0.0357,
0,
0.66,
... | [
"\"\"\"Manages performance counters of an application and/or its modules.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"def incr_counter_global_value(unused_name, unused_delta):\n \"\"\"Hook method for global aggregation.\"\"\"\n pass",
" \"\"\"Hook method for global aggregation.\"\"... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1974,
0.0132,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2237,
0.0132,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.25,
0.0132,
0,
0.66,
... | [
"\"\"\"Utility functions common to analytics module.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import os",
"import sys",
"import appengine_config",
"def _generators_for_visualizations(visualizations):\n ret = set()\n for visualization in visualizations:\n ret.update(visualiz... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0625,
0.0042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0708,
0.0042,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0792,
0.0042,
0,
0.66,... | [
"\"\"\"Module providing visualizations display as HTML/JS.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"from common import safe_dom",
"from controllers import utils",
"from models import data_sources",
"from models import jobs",
"from models import transforms",
"from models.analytics im... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.063,
0.0042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0714,
0.0042,
0,
0.66,
0.0588,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0798,
0.0042,
0,
0.66,
... | [
"\"\"\"Module providing public analytics interfaces.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import os",
"import re",
"import jinja2",
"import appengine_config",
"from controllers import sites",
"from controllers import utils as controllers_utils",
"from models.analytics import d... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0478,
0.0207,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.062,
0.0026,
0,
0.66,
0.0417,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0672,
0.0026,
0,
0.66,
... | [
"\"\"\"Manages dynamic properties of an application and/or its modules.\n\nAn application must explicitly declare properties and provide a type, doc string\nand default value for each. The default property values are overridden by\nthe new values found in the environment variable with the same name. Those are\nfurt... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0125,
0.0008,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0142,
0.0008,
0,
0.66,
0.0164,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0158,
0.0008,
0,
0.66,... | [
"\"\"\"Handlers that are not directly related to course content.\"\"\"",
"__author__ = 'Saifu Angto (saifu@google.com)'",
"import datetime",
"import HTMLParser",
"import os",
"import re",
"import urllib",
"import urlparse",
"import jinja2",
"import sites",
"import webapp2",
"import appengine_c... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0112,
0.0007,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0127,
0.0007,
0,
0.66,
0.0185,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0142,
0.0007,
0,
0.66,... | [
"\"\"\"Handlers for generating various frontend pages.\"\"\"",
"__author__ = 'Saifu Angto (saifu@google.com)'",
"import copy",
"import datetime",
"import urllib",
"import urlparse",
"from utils import BaseHandler",
"from utils import BaseRESTHandler",
"from utils import CAN_PERSIST_ACTIVITY_EVENTS",... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0655,
0.0044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0742,
0.0044,
0,
0.66,
0.0556,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.083,
0.0044,
0,
0.66,
... | [
"\"\"\"Classes and methods to manage all aspects of student assessments.\"\"\"",
"__author__ = 'pgbovine@google.com (Philip Guo)'",
"import datetime",
"import logging",
"from utils import BaseHandler",
"from utils import HUMAN_READABLE_DATETIME_FORMAT",
"from controllers import lessons",
"from models ... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0685,
0.0046,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0776,
0.0046,
0,
0.66,
0.25,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.379,
0.5799,
0,
0.66,
... | [
"\"\"\"Unified method of referring to to heterogenous resources in courses\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"class AbstractResourceHandler(object):\n \"\"\"Unified accessor for heterogenous resources within CourseBuilder.\n\n CourseBuilder contains a number of different resources... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0607,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0688,
0.004,
0,
0.66,
0.0385,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0769,
0.004,
0,
0.66,
... | [
"\"\"\"General utility functions common to all of CourseBuilder.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import cStringIO",
"import datetime",
"import logging",
"import random",
"import re",
"import string",
"import sys",
"import traceback",
"import zipfile",
"import appeng... |
#!/usr/bin/python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [
[
8,
0,
0.0733,
0.0043,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0819,
0.0043,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0905,
0.0043,
0,
0.66,
... | [
"\"\"\"Classes for processing various .yaml files in CourseBuilder installations.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import copy",
"import re",
"import yaml",
"NEWLINE_BEFORE_YAML_SECTIONS = set([\n 'env_variables',\n 'includes',\n 'inbound_services',\n 'builtins',\n ... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0487,
0.0032,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0552,
0.0032,
0,
0.66,
0.0476,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0617,
0.0032,
0,
0.66,... | [
"\"\"\"Encryption and digest functionality.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import base64",
"import hashlib",
"import hmac",
"import os",
"import random",
"import time",
"import appengine_config",
"from common import utils",
"from models import config",
"from google... |
# -*- coding: utf-8; -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
[
8,
0,
0.1088,
0.0068,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1224,
0.0068,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1361,
0.0068,
0,
0.66,... | [
"\"\"\"Functions used for Course Builder locale support.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import logging",
"import os",
"import re",
"import appengine_config",
"LOCALES_DISPLAY_NAMES = {\n 'af': u'Afrikaans (af)',\n 'am': u'አማርኛ (am)',\n 'ar': u'العربية (ar)',\n 'bg': u'... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0811,
0.0054,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0919,
0.0054,
0,
0.66,
0.0385,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1027,
0.0054,
0,
0.66,... | [
"\"\"\"Custom Jinja2 filters used in Course Builder.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import sys",
"import traceback",
"import jinja2",
"import safe_dom",
"import tags",
"from webapp2_extras import i18n",
"import appengine_config",
"from common import caching",
"from models ... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0225,
0.0015,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0254,
0.0015,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0284,
0.0015,
0,
0.66,... | [
"\"\"\"Mapping from schema to backend properties.\"\"\"",
"__author__ = 'Abhinav Khandelwal (abhinavk@google.com)'",
"import collections",
"import copy",
"import json",
"class Property(object):\n \"\"\"Property.\"\"\"\n\n def __init__(\n self, name, label, property_type, select_data=None, des... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1154,
0.0077,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1308,
0.0077,
0,
0.66,
0.1,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1462,
0.0077,
0,
0.66,
... | [
"\"\"\"Module providing simplistic logger.\"\"\"",
"__author__ = 'Mike Gainer (mgainer@google.com)'",
"import datetime",
"import logging",
"import traceback",
"import appengine_config",
"_LOG_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%f'",
"_CRITICAL = 'critical'",
"_WARNING = 'warning'",
"_INFO = 'info'",... |
"""Classes to build sanitized HTML."""
__author__ = 'John Orr (jorr@google.com)'
import cgi
import re
def escape(strg):
return cgi.escape(strg, quote=1).replace("'", ''').replace('`', '`')
class Node(object):
"""Base class for the sanitizing module."""
def __init__(self):
self._parent... | [
[
8,
0,
0.0032,
0.0032,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0095,
0.0032,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0158,
0.0032,
0,
0.66,... | [
"\"\"\"Classes to build sanitized HTML.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import cgi",
"import re",
"def escape(strg):\n return cgi.escape(strg, quote=1).replace(\"'\", ''').replace('`', '`')",
" return cgi.escape(strg, quote=1).replace(\"'\", ''').replace('`', '`... |
# -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
[
8,
0,
0.0233,
0.0356,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0416,
0.0004,
0,
0.66,
0.0244,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0427,
0.0004,
0,
0.66,... | [
"\"\"\"HTML content transformation and manipulation functions.\n\nAbout\n\n This module performs complex HTML document transformations, which enable\n machine-assisted internationalization (I18N) of content.",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import difflib",
"import htmlentitydefs... |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0274,
0.0018,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0311,
0.0018,
0,
0.66,
0.0435,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0366,
0.0018,
0,
0.66,... | [
"\"\"\"Helper classes to implement caching.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import collections",
"import datetime",
"import logging",
"import sys",
"import threading",
"import unittest",
"import appengine_config",
"from models.counters import PerfCounter",
"def ite... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.033,
0.0022,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0374,
0.0022,
0,
0.66,
0.037,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0441,
0.0022,
0,
0.66,
... | [
"\"\"\"Handlers for custom HTML tags.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import logging",
"import mimetypes",
"import os",
"import re",
"from xml.etree import cElementTree",
"import html5lib",
"import lxml.html",
"import safe_dom",
"import webapp2",
"import appengine_config"... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#################################################################
#
# 功能简述:通过读取网页信息,获取工行实时的纸黄金价格
#
#
# 传入参数: icbc_gold.py
#
# 摘 要: ... | [
[
1,
0,
0.083,
0.0044,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0873,
0.0044,
0,
0.66,
0.0588,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0917,
0.0044,
0,
0... | [
"import sys",
"import os",
"import ConfigParser",
"import urllib2",
"from HTMLParser import HTMLParser",
"import time",
"import sqlite3",
"import socket",
"socket.setdefaulttimeout(15.0)",
"send_sms_flag = False",
"INI_FILE = \"./icbc_gold.ini\"",
"def get_conf(search_section, search_option, d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#################################################################
#
# 功能简述:通过读取网页信息,获取工行实时的纸黄金价格
#
#
# 传入参数: icbc_gold.py
#
# 摘 要: ... | [
[
1,
0,
0.083,
0.0044,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0873,
0.0044,
0,
0.66,
0.0588,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0917,
0.0044,
0,
0... | [
"import sys",
"import os",
"import ConfigParser",
"import urllib2",
"from HTMLParser import HTMLParser",
"import time",
"import sqlite3",
"import socket",
"socket.setdefaulttimeout(15.0)",
"send_sms_flag = False",
"INI_FILE = \"./icbc_gold.ini\"",
"def get_conf(search_section, search_option, d... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.02,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
class Corpus(object):
'''
represents a corpus of unique words and their mode
'''
def S(self):
'''
Gets the total size of words that were added to the corpus
'''
if self.s == 0:
self.s=... | [
[
3,
0,
0.5165,
0.956,
0,
0.66,
0,
906,
0,
9,
0,
0,
186,
0,
16
],
[
8,
1,
0.0659,
0.033,
1,
0.86,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
1,
0.1264,
0.0879,
1,
0.86,
... | [
"class Corpus(object):\n '''\n represents a corpus of unique words and their mode\n '''\n def S(self):\n '''\n Gets the total size of words that were added to the corpus\n '''",
" '''\n represents a corpus of unique words and their mode\n '''",
" def S(self):\n ... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
V = 300000
import math
class HeldOut:
'''
Represents a Heldout smoothing method
'''
def __init__(self, corpusT, corpusH):
'''
Constructor
'''
self.corpusT = corpusT #training corpus
self.corpusH = corpu... | [
[
14,
0,
0.0325,
0.0081,
0,
0.66,
0,
442,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.0488,
0.0081,
0,
0.66,
0.5,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.5325,
0.9431,
0,
0.66... | [
"V = 300000",
"import math",
"class HeldOut:\n '''\n Represents a Heldout smoothing method\n '''\n \n def __init__(self, corpusT, corpusH):\n '''\n Constructor",
" '''\n Represents a Heldout smoothing method\n '''",
" def __init__(self, corpusT, corpusH):\n ''... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
from Corpus import *
import math
V = 300000
class Lidstone:
'''
Represents a Lidstone smoothing method
'''
def __init__(self, corpus):
'''
Constructor
'''
self.corpus = corpus # corpus
... | [
[
1,
0,
0.0354,
0.0088,
0,
0.66,
0,
906,
0,
1,
0,
0,
906,
0,
0
],
[
1,
0,
0.0531,
0.0088,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.0708,
0.0088,
0,
... | [
"from Corpus import *",
"import math",
"V = 300000",
"class Lidstone:\n '''\n Represents a Lidstone smoothing method\n '''\n \n def __init__(self, corpus):\n '''\n Constructor",
" '''\n Represents a Lidstone smoothing method\n '''",
" def __init__(self, corpus):\n ... |
# Matan Keidar 066500992
# Eliahu Khalastchi 040854705
from Utils import *
import random
import math
debug = True # debug symbol (used for debug printouts)
NUM_TOPICS = 9 # number of clusters
NUM_UNIQUE_WORDS = 0 # number of unique words in documents
NUM_DOCS = 0 # number of documen... | [
[
1,
0,
0.0105,
0.0026,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
1,
0,
0.0131,
0.0026,
0,
0.66,
0.0238,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0157,
0.0026,
0,
... | [
"from Utils import *",
"import random",
"import math",
"debug = True # debug symbol (used for debug printouts)",
"NUM_TOPICS = 9 # number of clusters",
"NUM_UNIQUE_WORDS = 0 # number of unique words in documents",
"NUM_DOCS = 0 # number of documents in training set",
... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
from Corpus import Corpus
def zeroList(n):
'''
creates a new list initialized to n zeros
'''
retList = []
for i in range(n):
retList.append(0.0)
return retList
def zeroMatrix(n,m):
'''
creates a new list of lists i... | [
[
1,
0,
0.0325,
0.0081,
0,
0.66,
0,
906,
0,
1,
0,
0,
906,
0,
0
],
[
2,
0,
0.0854,
0.0813,
0,
0.66,
0.2,
494,
0,
1,
1,
0,
0,
0,
2
],
[
8,
1,
0.065,
0.0244,
1,
0.52,
... | [
"from Corpus import Corpus",
"def zeroList(n):\n '''\n creates a new list initialized to n zeros\n '''\n retList = []\n \n for i in range(n):\n retList.append(0.0)",
" '''\n creates a new list initialized to n zeros\n '''",
" retList = []",
" for i in range(n):\n ... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
class Corpus(object):
'''
represents a corpus of unique words and their mode
'''
def S(self):
'''
Gets the total size of words that were added to the corpus
'''
if self.s == 0:
self.s=... | [
[
3,
0,
0.5169,
0.9551,
0,
0.66,
0,
906,
0,
9,
0,
0,
186,
0,
15
],
[
8,
1,
0.0674,
0.0337,
1,
0.17,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
1,
0.1292,
0.0899,
1,
0.17,
... | [
"class Corpus(object):\n '''\n represents a corpus of unique words and their mode\n '''\n def S(self):\n '''\n Gets the total size of words that were added to the corpus\n '''",
" '''\n represents a corpus of unique words and their mode\n '''",
" def S(self):\n ... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
from ModelUtils import *
from Backoff import Backoff
utils = ModelUtils()
backoff = utils.getBackoffModel()
(myLambda,bestPerplexity) = backoff.calcBestLambda("train10.txt")
print "the lambda chosen is",myLambda
print "its perplexity is",bestPer... | [
[
1,
0,
0.1923,
0.0385,
0,
0.66,
0,
193,
0,
1,
0,
0,
193,
0,
0
],
[
1,
0,
0.2308,
0.0385,
0,
0.66,
0.0909,
887,
0,
1,
0,
0,
887,
0,
0
],
[
14,
0,
0.3462,
0.0385,
0,
... | [
"from ModelUtils import *",
"from Backoff import Backoff",
"utils = ModelUtils()",
"backoff = utils.getBackoffModel()",
"(myLambda,bestPerplexity) = backoff.calcBestLambda(\"train10.txt\")",
"print(\"the lambda chosen is\",myLambda)",
"print(\"its perplexity is\",bestPerplexity)",
"print(\"the perplex... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
class Corpus(object):
'''
represents a corpus of unique words and their mode
'''
def S(self):
'''
Gets the total size of words that were added to the corpus
'''
if self.s == 0:
self.s=... | [
[
3,
0,
0.5165,
0.956,
0,
0.66,
0,
906,
0,
9,
0,
0,
186,
0,
16
],
[
8,
1,
0.0659,
0.033,
1,
0.91,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
1,
0.1264,
0.0879,
1,
0.91,
... | [
"class Corpus(object):\n '''\n represents a corpus of unique words and their mode\n '''\n def S(self):\n '''\n Gets the total size of words that were added to the corpus\n '''",
" '''\n represents a corpus of unique words and their mode\n '''",
" def S(self):\n ... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
V = 300000
import math
class HeldOut:
'''
Represents a Heldout smoothing method
'''
def __init__(self, corpusT, corpusH):
'''
Constructor
'''
self.corpusT = corpusT #training corpus
self.corpusH = corpu... | [
[
14,
0,
0.0325,
0.0081,
0,
0.66,
0,
442,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.0488,
0.0081,
0,
0.66,
0.5,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.5325,
0.9431,
0,
0.66... | [
"V = 300000",
"import math",
"class HeldOut:\n '''\n Represents a Heldout smoothing method\n '''\n \n def __init__(self, corpusT, corpusH):\n '''\n Constructor",
" '''\n Represents a Heldout smoothing method\n '''",
" def __init__(self, corpusT, corpusH):\n ''... |
'''
Created on Jan 10, 2010
@author: matan
'''
import math
class BigramLidstone():
'''
Represents a bigram Lidstone smoothing model
'''
def __init__(self, uniCorpus, biCorpus):
'''
Constructor
'''
self.V = 300000
self.corpus = uniCorpus # corpus
... | [
[
8,
0,
0.0536,
0.0893,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.125,
0.0179,
0,
0.66,
0.5,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.5714,
0.8393,
0,
0.66,
... | [
"'''\nCreated on Jan 10, 2010\n\n@author: matan\n'''",
"import math",
"class BigramLidstone():\n '''\n Represents a bigram Lidstone smoothing model\n '''\n\n\n def __init__(self, uniCorpus, biCorpus):\n '''",
" '''\n Represents a bigram Lidstone smoothing model\n '''",
" def _... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
from Corpus import *
import math
class Lidstone:
'''
Represents a Lidstone smoothing method
'''
def __init__(self, corpus):
'''
Constructor
'''
print "unigram Lidstone CTOR"
... | [
[
1,
0,
0.0336,
0.0084,
0,
0.66,
0,
906,
0,
1,
0,
0,
906,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.5,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.542,
0.9244,
0,
0.66... | [
"from Corpus import *",
"import math",
"class Lidstone:\n '''\n Represents a Lidstone smoothing method\n '''\n \n def __init__(self, corpus):\n '''\n Constructor",
" '''\n Represents a Lidstone smoothing method\n '''",
" def __init__(self, corpus):\n '''\n ... |
#Matan Keidar 066500992
#Eliahu Khalastchi 040854705
from Corpus import Corpus
class BigramCorpus():
'''
Represents a corpus that holds bigrams of words
'''
def __init__(self, fileName, uniCorpus):
'''
Constructor
'''
self.unigramCorpus = uniCorpus
self.bigr... | [
[
1,
0,
0.0435,
0.0109,
0,
0.66,
0,
906,
0,
1,
0,
0,
906,
0,
0
],
[
3,
0,
0.5272,
0.9348,
0,
0.66,
1,
310,
0,
7,
0,
0,
0,
0,
13
],
[
8,
1,
0.087,
0.0326,
1,
0.29,
... | [
"from Corpus import Corpus",
"class BigramCorpus():\n '''\n Represents a corpus that holds bigrams of words \n '''\n\n\n def __init__(self, fileName, uniCorpus):\n '''",
" '''\n Represents a corpus that holds bigrams of words \n '''",
" def __init__(self, fileName, uniCorpus):... |
#!/usr/bin/python
import sys, hashlib
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def usage():
print ("Usage: " + sys.argv[0] + " infile outfile label")
def main():
if( len(sys.argv) != 4):
usage()
sys.exit()
fp = open( sys.argv[1] , "rb")
hash_str = has... | [
[
1,
0,
0.0714,
0.0238,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.1548,
0.0952,
0,
0.66,
0.25,
725,
0,
2,
0,
0,
0,
0,
3
],
[
14,
1,
0.1429,
0.0238,
1,
0.2... | [
"import sys, hashlib",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\tfp.write(buf)",
"\tfp.close()",
"def usage():\n\tprint (\"Usage: \" + sys.argv[0] + \" infile outfile label\")",
"\tprint (\"Usage: \" + sys.argv[0] + \" infile outfi... |
#!/usr/bin/python
import sys, re, os
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def usage():
print ("Usage: " + os.path.split(__file__)[1] + " version outfile")
def crete_version_str(ver):
base = list("0.00")
version = str(ver)
ret = []
base[0] = version[0]
base... | [
[
1,
0,
0.0577,
0.0192,
0,
0.66,
0,
509,
0,
3,
0,
0,
509,
0,
0
],
[
2,
0,
0.125,
0.0769,
0,
0.66,
0.2,
725,
0,
2,
0,
0,
0,
0,
3
],
[
14,
1,
0.1154,
0.0192,
1,
0.08,... | [
"import sys, re, os",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\tfp.write(buf)",
"\tfp.close()",
"def usage():\n\tprint (\"Usage: \" + os.path.split(__file__)[1] + \" version outfile\")",
"\tprint (\"Usage: \" + os.path.split(__file... |
#!/usr/bin/python
""" PRO build script"""
import os, shutil, sys
NIGHTLY=0
VERSION="B10"
PRO_BUILD = [
{ "fn": "620PRO-%s.rar", "config": "CONFIG_620=1" },
{ "fn": "635PRO-%s.rar", "config": "CONFIG_635=1" },
{ "fn": "639PRO-%s.rar", "config": "CONFIG_639=1" },
{ "fn": "660PRO-%s.rar", "config": "CONFIG... | [
[
8,
0,
0.0297,
0.0099,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0495,
0.0099,
0,
0.66,
0.0909,
688,
0,
3,
0,
0,
688,
0,
0
],
[
14,
0,
0.0693,
0.0099,
0,
0.6... | [
"\"\"\" PRO build script\"\"\"",
"import os, shutil, sys",
"NIGHTLY=0",
"VERSION=\"B10\"",
"PRO_BUILD = [\n\t\t\t{ \"fn\": \"620PRO-%s.rar\", \"config\": \"CONFIG_620=1\" },\n\t\t\t{ \"fn\": \"635PRO-%s.rar\", \"config\": \"CONFIG_635=1\" },\n\t\t\t{ \"fn\": \"639PRO-%s.rar\", \"config\": \"CONFIG_639=1\" }... |
#!/usr/bin/python
import sys, os, gzip, StringIO
def dump_binary(fn, data):
f = open(fn, "wb")
f.write(data)
f.close()
def dec_prx(fn):
f = open(fn, "rb")
f.seek(0x150)
dat = f.read()
f.close()
temp=StringIO.StringIO(dat)
f=gzip.GzipFile(fileobj=temp, mode='rb')
dec = f.read(f)
f.close()
fn = "%s.dec.p... | [
[
1,
0,
0.0909,
0.0303,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
2,
0,
0.197,
0.1212,
0,
0.66,
0.25,
336,
0,
2,
0,
0,
0,
0,
3
],
[
14,
1,
0.1818,
0.0303,
1,
0.39... | [
"import sys, os, gzip, StringIO",
"def dump_binary(fn, data):\n\tf = open(fn, \"wb\")\n\tf.write(data)\n\tf.close()",
"\tf = open(fn, \"wb\")",
"\tf.write(data)",
"\tf.close()",
"def dec_prx(fn):\n\tf = open(fn, \"rb\")\n\tf.seek(0x150)\n\tdat = f.read()\n\tf.close()\n\n\ttemp=StringIO.StringIO(dat)\n\tf=... |
#!/usr/bin/python
class FakeTime:
def time(self):
return 1225856967.109
import sys, os, struct, gzip, hashlib, StringIO
gzip.time = FakeTime()
def binary_replace(data, newdata, offset):
return data[0:offset] + newdata + data[offset+len(newdata):]
def prx_compress(output, hdr, input, mod_name="", mod_a... | [
[
3,
0,
0.0488,
0.0366,
0,
0.66,
0,
425,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.0549,
0.0244,
1,
0.93,
0,
654,
0,
1,
1,
0,
0,
0,
0
],
[
13,
2,
0.061,
0.0122,
2,
0.57,
... | [
"class FakeTime:\n def time(self):\n return 1225856967.109",
" def time(self):\n return 1225856967.109",
" return 1225856967.109",
"import sys, os, struct, gzip, hashlib, StringIO",
"gzip.time = FakeTime()",
"def binary_replace(data, newdata, offset):\n\treturn data[0:offset] + ... |
#!/usr/bin/python
import sys, hashlib
def toNID(name):
hashstr = hashlib.sha1(name.encode()).hexdigest().upper()
return "0x" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + hashstr[0:2]
if __name__ == "__main__":
assert(toNID("sceKernelCpuSuspendIntr") == "0x092968F4")
for name in sys.argv[1:]:
print ("%s: %s"... | [
[
1,
0,
0.2308,
0.0769,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.4615,
0.2308,
0,
0.66,
0.5,
259,
0,
1,
1,
0,
0,
0,
4
],
[
14,
1,
0.4615,
0.0769,
1,
0.33... | [
"import sys, hashlib",
"def toNID(name):\n\thashstr = hashlib.sha1(name.encode()).hexdigest().upper()\n\treturn \"0x\" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + hashstr[0:2]",
"\thashstr = hashlib.sha1(name.encode()).hexdigest().upper()",
"\treturn \"0x\" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + ha... |
#!/usr/bin/python
from hashlib import *
import sys, struct
def sha512(psid):
if len(psid) != 16:
return "".encode()
for i in range(512):
psid = sha1(psid).digest()
return psid
def get_psid(str):
if len(str) != 32:
return "".encode()
b = "".encode()
for i in range(0, len(str), 2):
b += struct.pack('B... | [
[
1,
0,
0.0652,
0.0217,
0,
0.66,
0,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.087,
0.0217,
0,
0.66,
0.2,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.2065,
0.1739,
0,
0.66... | [
"from hashlib import *",
"import sys, struct",
"def sha512(psid):\n\tif len(psid) != 16:\n\t\treturn \"\".encode()\n\n\tfor i in range(512):\n\t\tpsid = sha1(psid).digest()\n\n\treturn psid",
"\tif len(psid) != 16:\n\t\treturn \"\".encode()",
"\t\treturn \"\".encode()",
"\tfor i in range(512):\n\t\tpsid =... |
#!/usr/bin/python
"""
pspbtcnf_editor: An script that add modules from pspbtcnf
"""
import sys, os, re
from getopt import *
from struct import *
BTCNF_MAGIC=0x0F803001
verbose = False
def print_usage():
print ("%s: pspbtcnf.bin [-o output.bin] [-a add_module_name:before_module_name:flag]" %(os.path... | [
[
8,
0,
0.022,
0.0165,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0385,
0.0055,
0,
0.66,
0.0769,
509,
0,
3,
0,
0,
509,
0,
0
],
[
1,
0,
0.044,
0.0055,
0,
0.66,
... | [
"\"\"\"\npspbtcnf_editor: An script that add modules from pspbtcnf\n\"\"\"",
"import sys, os, re",
"from getopt import *",
"from struct import *",
"BTCNF_MAGIC=0x0F803001",
"verbose = False",
"def print_usage():\n\tprint (\"%s: pspbtcnf.bin [-o output.bin] [-a add_module_name:before_module_name:flag]\" ... |
#!/usr/bin/python
import os
def main():
lists = [
"ISODrivers/Galaxy/galaxy.prx",
"ISODrivers/March33/march33.prx",
"ISODrivers/March33/march33_620.prx",
"ISODrivers/March33/march33_660.prx",
"ISODrivers/Inferno/inferno.prx",
"Popcorn/popcorn.prx",
"Satelite/satelite.prx",
"Stargate/stargate.... | [
[
1,
0,
0.1034,
0.0345,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.5345,
0.7586,
0,
0.66,
0.5,
624,
0,
0,
0,
0,
0,
0,
3
],
[
14,
1,
0.431,
0.4828,
1,
0.14,... | [
"import os",
"def main():\n\tlists = [\n\t\t\t\"ISODrivers/Galaxy/galaxy.prx\",\n\t\t\t\"ISODrivers/March33/march33.prx\",\n\t\t\t\"ISODrivers/March33/march33_620.prx\",\n\t\t\t\"ISODrivers/March33/march33_660.prx\",\n\t\t\t\"ISODrivers/Inferno/inferno.prx\",\n\t\t\t\"Popcorn/popcorn.prx\",",
"\tlists = [\n\t\t... |
#!/usr/bin/python
class FakeTime:
def time(self):
return 1225856967.109
import os, gzip, StringIO
gzip.time = FakeTime()
def create_gzip(input, output):
f_in=open(input, 'rb')
temp=StringIO.StringIO()
f=gzip.GzipFile(fileobj=temp, mode='wb')
f.writelines(f_in)
f.close()
f_in.close()
fout=open(out... | [
[
3,
0,
0.0909,
0.0682,
0,
0.66,
0,
425,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.1023,
0.0455,
1,
0.14,
0,
654,
0,
1,
1,
0,
0,
0,
0
],
[
13,
2,
0.1136,
0.0227,
2,
0.03,
... | [
"class FakeTime:\n def time(self):\n return 1225856967.109",
" def time(self):\n return 1225856967.109",
" return 1225856967.109",
"import os, gzip, StringIO",
"gzip.time = FakeTime()",
"def create_gzip(input, output):\n\tf_in=open(input, 'rb')\n\ttemp=StringIO.StringIO()\n\tf=g... |
#!/usr/bin/python
import os, sys, getopt
def usage():
print ("Usage: %s [-l size ] basefile input output" % (sys.argv[0]))
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def main():
inputsize = 0
try:
optlist, args = getopt.getopt(sys.argv[1:], 'l:h')
except getopt.GetoptError:
us... | [
[
1,
0,
0.0536,
0.0179,
0,
0.66,
0,
688,
0,
3,
0,
0,
688,
0,
0
],
[
2,
0,
0.0982,
0.0357,
0,
0.66,
0.25,
129,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.1071,
0.0179,
1,
0.69... | [
"import os, sys, getopt",
"def usage():\n\tprint (\"Usage: %s [-l size ] basefile input output\" % (sys.argv[0]))",
"\tprint (\"Usage: %s [-l size ] basefile input output\" % (sys.argv[0]))",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\t... |
# -*- coding: cp1252 -*-
##########################
# #
# ResumeX (V.0.4) #
# By Stanley87 #
# #
####### #######
# ... | [
[
1,
0,
0.2373,
0.0169,
0,
0.66,
0,
280,
0,
2,
0,
0,
280,
0,
0
],
[
1,
0,
0.2542,
0.0169,
0,
0.66,
0.1429,
890,
0,
4,
0,
0,
890,
0,
0
],
[
14,
0,
0.2712,
0.0169,
0,
... | [
"import xbmcgui, xbmc",
"import string, time, re, os",
"Root_Dir = os.getcwd().replace(\";\",\"\")+\"\\\\\"",
"SETTINGFILE = Root_Dir + \"lib\\settings.xml\"",
"class main:\n def gui(self):\n self.passme = 0\n dialog = xbmcgui.Dialog()\n if dialog.yesno(\"ResumeX\",\"Enable ResumeX?\... |
# -*- coding: cp1252 -*-
##########################
# #
# ResumeX (V.0.4) #
# By Stanley87 #
# #
####### #######
# ... | [
[
1,
0,
0.0455,
0.0032,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
1,
0,
0.0487,
0.0032,
0,
0.66,
0.0909,
890,
0,
5,
0,
0,
890,
0,
0
],
[
1,
0,
0.0519,
0.0032,
0,
... | [
"import sys, email, xbmcgui, xbmc",
"import string, time, mimetypes, re, os",
"import shutil",
"SLEEPTIME = 2 #seconds",
"Root_Dir = os.getcwd().replace(\";\",\"\")+\"\\\\\"",
"TEST = Root_Dir + \"lib\\\\\"",
"SETTINGFILE = Root_Dir + \"settings.xml\"",
"DATAFILE = Root_Dir + \"data.xml\"",
"SETTING... |
import xbmc
xbmc.executescript('Q:\scripts\ResumeX\lib\engine.py')
| [
[
1,
0,
0.5,
0.25,
0,
0.66,
0,
877,
0,
1,
0,
0,
877,
0,
0
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
675,
3,
1,
0,
0,
0,
0,
1
]
] | [
"import xbmc",
"xbmc.executescript('Q:\\scripts\\ResumeX\\lib\\engine.py')"
] |
# Switch splash.png script by Asteron
# v1.0 - 2007/02/21
# http://asteron.projects.googlepages.com/
import os, shutil, traceback
import xbmc, xbmcgui
def main():
splashfile = 'Q:\\media\\splash.png'
skinname = xbmc.getSkinDir()
trimmedname = ''.join(skinname.lower().split())
customsplash = 'Q:\\skin... | [
[
1,
0,
0.1667,
0.0333,
0,
0.66,
0,
688,
0,
3,
0,
0,
688,
0,
0
],
[
1,
0,
0.2,
0.0333,
0,
0.66,
0.3333,
877,
0,
2,
0,
0,
877,
0,
0
],
[
2,
0,
0.5667,
0.6333,
0,
0.6... | [
"import os, shutil, traceback",
"import xbmc, xbmcgui",
"def main():\n\tsplashfile = 'Q:\\\\media\\\\splash.png'\n\tskinname = xbmc.getSkinDir()\n\ttrimmedname = ''.join(skinname.lower().split())\n\tcustomsplash = 'Q:\\\\skin\\\\' + skinname + '\\\\extras\\\\splash.png'\n\tsplashbackup = 'Q:\\\\media\\\\splash.... |
# Dummy file to make this directory a package.
| [] | [] |
# Dummy file to make this directory a package.
| [] | [] |
"""
Scraper for http://lyrc.com.ar/
"""
import os
import urllib
import re
__title__ = "lyrc.com.ar"
__allow_exceptions__ = False
class LyricsFetcher:
def __init__( self ):
self.base_url = "http://lyrc.com.ar/en/tema1en.php"
def get_lyrics(self, artist, song):
params... | [
[
8,
0,
0.0333,
0.0533,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.08,
0.0133,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0933,
0.0133,
0,
0.66,
... | [
"\"\"\"\nScraper for http://lyrc.com.ar/\n\n\"\"\"",
"import os",
"import urllib",
"import re",
"__title__ = \"lyrc.com.ar\"",
"__allow_exceptions__ = False",
"class LyricsFetcher:\n def __init__( self ):\n self.base_url = \"http://lyrc.com.ar/en/tema1en.php\"\n \n def get_lyrics(sel... |
# Dummy file to make this directory a package.
| [] | [] |
# Dummy file to make this directory a package.
| [] | [] |
"""
Scraper for embedded lyrics
Nuka1195
"""
if ( __name__ != "__main__" ):
import xbmc
import re
__title__ = "Embedded Lyrics"
__allow_exceptions__ = False
class LyricsFetcher:
""" required: Fetcher Class for embedded lyrics """
def __init__( self ):
self.pattern = "USLT.*?[A-... | [
[
8,
0,
0.0455,
0.0758,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
4,
0,
0.1136,
0.0303,
0,
0.66,
0.1667,
0,
0,
0,
0,
0,
0,
0,
0
],
[
1,
1,
0.1212,
0.0152,
1,
0.89,
... | [
"\"\"\"\nScraper for embedded lyrics\n\nNuka1195\n\"\"\"",
"if ( __name__ != \"__main__\" ):\n import xbmc",
" import xbmc",
"import re",
"__title__ = \"Embedded Lyrics\"",
"__allow_exceptions__ = False",
"class LyricsFetcher:\n \"\"\" required: Fetcher Class for embedded lyrics \"\"\"\n def... |
# Dummy file to make this directory a package.
| [] | [] |
"""
Settings module
Nuka1195
"""
import sys
import os
import xbmc
import xbmcgui
from resources.lib.utilities import *
_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
__svn_revision__ = sys.modul... | [
[
8,
0,
0.0113,
0.0189,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0264,
0.0038,
0,
0.66,
0.1,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0302,
0.0038,
0,
0.66,
... | [
"\"\"\"\nSettings module\n\nNuka1195\n\"\"\"",
"import sys",
"import os",
"import xbmc",
"import xbmcgui",
"from resources.lib.utilities import *",
"_ = sys.modules[ \"__main__\" ].__language__",
"__scriptname__ = sys.modules[ \"__main__\" ].__scriptname__",
"__version__ = sys.modules[ \"__main__\" ... |
"""
Update module
Nuka1195
"""
import sys
import os
import xbmcgui
import urllib
import socket
from sgmllib import SGMLParser
socket.setdefaulttimeout( 10 )
_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ]._... | [
[
8,
0,
0.0208,
0.0347,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0486,
0.0069,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0556,
0.0069,
0,
0.66... | [
"\"\"\"\nUpdate module\n\nNuka1195\n\"\"\"",
"import sys",
"import os",
"import xbmcgui",
"import urllib",
"import socket",
"from sgmllib import SGMLParser",
"socket.setdefaulttimeout( 10 )",
"_ = sys.modules[ \"__main__\" ].__language__",
"__scriptname__ = sys.modules[ \"__main__\" ].__scriptname... |
"""
Language module
Nuka1195
"""
import os
import xbmc
import xml.dom.minidom
class Language:
""" Language Class: creates a dictionary of localized strings { int: string } """
def __init__( self ):
""" initializer """
# language folder
base_path = os.path.join( os.get... | [
[
8,
0,
0.0448,
0.0746,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1045,
0.0149,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1194,
0.0149,
0,
0.66,
... | [
"\"\"\"\nLanguage module\n\nNuka1195\n\"\"\"",
"import os",
"import xbmc",
"import xml.dom.minidom",
"class Language:\n \"\"\" Language Class: creates a dictionary of localized strings { int: string } \"\"\"\n def __init__( self ):\n \"\"\" initializer \"\"\"\n # language folder\n ... |
"""
Credits modules
Nuka1195
"""
import sys
import xbmcgui
from resources.lib.utilities import *
_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
__svn_url__ = sys.modules[ "__main__" ].__svn_url__
... | [
[
8,
0,
0.0448,
0.0746,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1045,
0.0149,
0,
0.66,
0.1111,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1194,
0.0149,
0,
0.66... | [
"\"\"\"\nCredits modules\n\nNuka1195\n\"\"\"",
"import sys",
"import xbmcgui",
"from resources.lib.utilities import *",
"_ = sys.modules[ \"__main__\" ].__language__",
"__scriptname__ = sys.modules[ \"__main__\" ].__scriptname__",
"__version__ = sys.modules[ \"__main__\" ].__version__",
"__svn_url__ =... |
"""
Credits:
EnderW: Original Author
Stanley87: PM3 Integration and AD Removal
solexalex:
TomKun:
Thor918: MyPlayer Class
Smuto: Skinning Mod
Spiff: Unicode support
Nuka1195: lyricwiki & embedded Scraper and Modulization
Please report any bugs: http://www.xboxmedi... | [
[
8,
0,
0.023,
0.0426,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0492,
0.0033,
0,
0.66,
0.0714,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0525,
0.0033,
0,
0.66,... | [
"\"\"\"\n\tCredits:\t\n\t\tEnderW:\t\t\t\t\tOriginal Author\n\t\tStanley87:\t\t\t\tPM3 Integration and AD Removal\n\t\tsolexalex:\n\t\tTomKun:\n\t\tThor918:\t\t\t\tMyPlayer Class\n\t\tSmuto:\t\t\t\t\tSkinning Mod",
"import sys",
"import os",
"import xbmc",
"import xbmcgui",
"import threading",
"from res... |
"""
Catchall module for shared functions and constants
Nuka1195
"""
import sys
import os
import xbmc
import xbmcgui
DEBUG_MODE = 0
_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
__svn_revision__... | [
[
8,
0,
0.0171,
0.0286,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.04,
0.0057,
0,
0.66,
0.0256,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0457,
0.0057,
0,
0.66,
... | [
"\"\"\"\nCatchall module for shared functions and constants\n\nNuka1195\n\"\"\"",
"import sys",
"import os",
"import xbmc",
"import xbmcgui",
"DEBUG_MODE = 0",
"_ = sys.modules[ \"__main__\" ].__language__",
"__scriptname__ = sys.modules[ \"__main__\" ].__scriptname__",
"__version__ = sys.modules[ \... |
# Dummy file to make this directory a package.
| [] | [] |
"""
This script will create a playlist by recursively searching MUSIC_PATH and adding songs.
"""
import os
import xbmc
# add all music paths here, no subdirectories needed
MUSIC_PATH = ( "E:\\Music", "F:\\Music", )
# add all music extensions wanted in lowercase
MUSIC_EXT = ".nsv|.m4a|.flac|.aac|.strm|.pls|.rm|... | [
[
8,
0,
0.0667,
0.1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0333,
0,
0.66,
0.125,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1667,
0.0333,
0,
0.66,
... | [
"\"\"\"\nThis script will create a playlist by recursively searching MUSIC_PATH and adding songs.\n\"\"\"",
"import os",
"import xbmc",
"MUSIC_PATH = ( \"E:\\\\Music\", \"F:\\\\Music\", )",
"MUSIC_EXT = \".nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.mod|.amf|.669|.dmf|.dsm|.far|.g... |
# XBMC Lyrics script revision: 2111 - built with build.bat version 1.0 #
# main import's
import sys
import os
import xbmcgui
import xbmc
# Script constants
__scriptname__ = "XBMC Lyrics"
__author__ = "XBMC Lyrics Team"
__url__ = "http://code.google.com/p/xbmc-scripting/"
__svn_url__ = "http://xbmc-scrip... | [
[
1,
0,
0.08,
0.02,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1,
0.02,
0,
0.66,
0.0385,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.12,
0.02,
0,
0.66,
0.0... | [
"import sys",
"import os",
"import xbmcgui",
"import xbmc",
"__scriptname__ = \"XBMC Lyrics\"",
"__author__ = \"XBMC Lyrics Team\"",
"__url__ = \"http://code.google.com/p/xbmc-scripting/\"",
"__svn_url__ = \"http://xbmc-scripting.googlecode.com/svn/trunk/XBMC%20Lyrics\"",
"__credits__ = \"XBMC TEAM,... |
#!/usr/bin/python
#
# Lightpack hardware main tests
#
import lightpack, time, re, random, sys
print ('')
print ('Lightpack hardware main tests')
print ('')
print ('WARN: Disable authorization for proper execution of the script.')
print (' Open software, check "Profiles->Expert mode" and off auth on "Dev tab".')... | [
[
1,
0,
0.0547,
0.0078,
0,
0.66,
0,
635,
0,
5,
0,
0,
635,
0,
0
],
[
8,
0,
0.0703,
0.0078,
0,
0.66,
0.0345,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.0781,
0.0078,
0,
0.... | [
"import lightpack, time, re, random, sys",
"print ('')",
"print ('Lightpack hardware main tests')",
"print ('')",
"print ('WARN: Disable authorization for proper execution of the script.')",
"print (' Open software, check \"Profiles->Expert mode\" and off auth on \"Dev tab\".')",
"print ('')",
"R... |
import socket, time, imaplib, re, sys
class lightpack:
# host = '127.0.0.1' # The remote host
# port = 3636 # The same port as used by the server
# apikey = 'key' # Secure API key which generates by Lightpack software on Dev tab
# ledMap = [1,2,3,4,5,6,7,8,9,10] #mapped LEDs
def __init... | [
[
1,
0,
0.0079,
0.0079,
0,
0.66,
0,
687,
0,
5,
0,
0,
687,
0,
0
],
[
3,
0,
0.5079,
0.9764,
0,
0.66,
1,
635,
0,
19,
0,
0,
0,
0,
55
],
[
2,
1,
0.0945,
0.0394,
1,
0.83,... | [
"import socket, time, imaplib, re, sys",
"class lightpack:\n\n#\thost = '127.0.0.1' # The remote host\n#\tport = 3636 # The same port as used by the server\n#\tapikey = 'key'\t\t # Secure API key which generates by Lightpack software on Dev tab\n#\tledMap = [1,2,3,4,5,6,7,8,9,10] \t#mapped LEDs\n... |
#inaccurate pyLightpack class animation examples for 10 LED Lightpack configuration (3+2+3+2 clockwise from the left edge).
import lightpack, time, re, random
lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,4,5,1] )
lpack.connect()
lpack.lock()
first = True
while True :
for k in range (0, 10... | [
[
1,
0,
0.1111,
0.0556,
0,
0.66,
0,
635,
0,
4,
0,
0,
635,
0,
0
],
[
14,
0,
0.2222,
0.0556,
0,
0.66,
0.1667,
117,
3,
3,
0,
0,
635,
10,
1
],
[
8,
0,
0.2778,
0.0556,
0,
... | [
"import lightpack, time, re, random",
"lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,4,5,1] )",
"lpack.connect()",
"lpack.lock()",
"first = True",
"while True :\n\tfor k in range (0, 10) :\t\n\t\tif first :\n\t\t\tlpack.setColorToAll(80,0,0)\n\t\telse :\n\t\t\tlpack.setColorToAll(0,0,80)... |
from xml.dom import minidom
from xml.dom import EMPTY_NAMESPACE
try:
import json
except ImportError:
import simplejson as json
import lightpack
import time
import urllib
import urllib2
username = '***********'
password = '*************'
lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,... | [
[
1,
0,
0.0127,
0.0127,
0,
0.66,
0,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0253,
0.0127,
0,
0.66,
0.0345,
290,
0,
1,
0,
0,
290,
0,
0
],
[
7,
0,
0.057,
0.0506,
0,
0... | [
"from xml.dom import minidom",
"from xml.dom import EMPTY_NAMESPACE",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
" import simplejson as json",
"import lightpack",
"import time",
"import urllib",
"import urllib2",
"username = '***********'",
"passwo... |
#Skype contact waiting script. It flashes Lightpack when target buddy in contact list are changed his online status.
#You need Skype4Py module and lightpack.py class for using it.
import Skype4Py, lightpack, time, sys
skype = Skype4Py.Skype() # Create an instance of the Skype class
lpack = lightpack.lightpack('... | [
[
1,
0,
0.1379,
0.0345,
0,
0.66,
0,
279,
0,
4,
0,
0,
279,
0,
0
],
[
14,
0,
0.2069,
0.0345,
0,
0.66,
0.1429,
627,
3,
0,
0,
0,
969,
10,
1
],
[
14,
0,
0.2414,
0.0345,
0,
... | [
"import Skype4Py, lightpack, time, sys",
"skype = Skype4Py.Skype() # Create an instance of the Skype class",
"lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,4,5,1] )",
"skype.Attach() # Connect the Skype object to the Skype client",
"targetstat = ['ONLINE', 'DND', 'SKYPEME'] # Array of targe... |
#inaccurate pyLightpack class animation examples for 10 LED Lightpack configuration (3+2+3+2 clockwise from the left edge).
import lightpack, time, re, random
lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,4,5,1] )
lpack.connect()
lpack.lock()
print ('***pyLightpack animation examples (read scr... | [
[
1,
0,
0.0169,
0.0085,
0,
0.66,
0,
635,
0,
4,
0,
0,
635,
0,
0
],
[
14,
0,
0.0339,
0.0085,
0,
0.66,
0.1,
117,
3,
3,
0,
0,
635,
10,
1
],
[
8,
0,
0.0424,
0.0085,
0,
0... | [
"import lightpack, time, re, random",
"lpack = lightpack.lightpack('127.0.0.1', 3636, [2,3,6,7,8,9,10,4,5,1] )",
"lpack.connect()",
"lpack.lock()",
"print ('***pyLightpack animation examples (read script header first)***')",
"print ('\t1 -- Basic flash 4 times')",
"print ('\t2 -- \"Snake\"')",
"print ... |
# Gmail checker script. It check you mail thru IMAP and run clockwise "snake" effect if you have unread messages in the box
import lightpack, time, imaplib, re, getpass
def gmail_checker(username,password):
import imaplib,re
i=imaplib.IMAP4_SSL('imap.gmail.com')
try:
i.... | [
[
1,
0,
0.075,
0.025,
0,
0.66,
0,
635,
0,
5,
0,
0,
635,
0,
0
],
[
2,
0,
0.25,
0.275,
0,
0.66,
0.1667,
592,
0,
2,
1,
0,
0,
0,
9
],
[
1,
1,
0.15,
0.025,
1,
0.69,
... | [
"import lightpack, time, imaplib, re, getpass",
"def gmail_checker(username,password):\n import imaplib,re\n i=imaplib.IMAP4_SSL('imap.gmail.com')\n try:\n i.login(username,password)\n x,y=i.status('INBOX','(MESSAGES UNSEEN)')\n messages=int(re.sea... |
import socket, time, imaplib, re, sys
class lightpack:
# host = '127.0.0.1' # The remote host
# port = 3636 # The same port as used by the server
# apikey = 'key' # Secure API key which generates by Lightpack software on Dev tab
# ledMap = [1,2,3,4,5,6,7,8,9,10] #mapped LEDs
def __init... | [
[
1,
0,
0.0079,
0.0079,
0,
0.66,
0,
687,
0,
5,
0,
0,
687,
0,
0
],
[
3,
0,
0.5079,
0.9764,
0,
0.66,
1,
635,
0,
19,
0,
0,
0,
0,
55
],
[
2,
1,
0.0945,
0.0394,
1,
0.79,... | [
"import socket, time, imaplib, re, sys",
"class lightpack:\n\n#\thost = '127.0.0.1' # The remote host\n#\tport = 3636 # The same port as used by the server\n#\tapikey = 'key'\t\t # Secure API key which generates by Lightpack software on Dev tab\n#\tledMap = [1,2,3,4,5,6,7,8,9,10] \t#mapped LEDs\n... |
import Global
proc_name = ''
local_flag = 0
index = -1
s_index = 0
sav1 = ''
sav2 = ''
l_parameter = {}
l_value = []
env = ['.486\n.model flat, stdcall\noption casemap: none\n',
'include \masm32\include\windows.inc\n',
'include \masm32\include\kernel32.inc\n',
'include \masm32\include\m... | [
[
1,
0,
0.0018,
0.0018,
0,
0.66,
0,
154,
0,
1,
0,
0,
154,
0,
0
],
[
14,
0,
0.0035,
0.0018,
0,
0.66,
0.0385,
282,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0053,
0.0018,
0,
... | [
"import Global",
"proc_name = ''",
"local_flag = 0",
"index = -1",
"s_index = 0",
"sav1 = ''",
"sav2 = ''",
"l_parameter = {}",
"l_value = []",
"env = ['.486\\n.model flat, stdcall\\noption casemap: none\\n',\n 'include \\masm32\\include\\windows.inc\\n',\n 'include \\masm32\\i... |
from collections import deque
flag = [0 for x in range(0, 32)]
outputFile = ''
count_line = 0
tokens = {}
lexical_queue = deque([])
symbol_queue = deque([])
semantics_queue = deque([])
count_syntax_stack = 0
syntax_stack = [0]
symbol_stack = []
semantics_stack = []
symbol_table = [[],[]]
index = 0
T_m = 0
L_m =... | [
[
1,
0,
0.04,
0.04,
0,
0.66,
0,
193,
0,
1,
0,
0,
193,
0,
0
],
[
14,
0,
0.12,
0.04,
0,
0.66,
0.0625,
756,
5,
0,
0,
0,
0,
0,
1
],
[
14,
0,
0.2,
0.04,
0,
0.66,
0.1... | [
"from collections import deque",
"flag = [0 for x in range(0, 32)]",
"outputFile = ''",
"count_line = 0",
"tokens = {}",
"lexical_queue = deque([])",
"symbol_queue = deque([])",
"semantics_queue = deque([])",
"count_syntax_stack = 0",
"syntax_stack = [0]",
"symbol_stack = []",
"semantics_stack... |
import io, re
import Global
flag_l = 0
tokensPath = './Tokens.txt'
def insertToQueue(s1, s2, s3):
Global.lexical_queue.append(s1)
Global.symbol_queue.append(s2)
Global.semantics_queue.append(s3)
def importTokens():
tokensFile = file(tokensPath, 'r')
i = 1
for line in tokensFile:
Globa... | [
[
1,
0,
0.0076,
0.0076,
0,
0.66,
0,
518,
0,
2,
0,
0,
518,
0,
0
],
[
1,
0,
0.0153,
0.0076,
0,
0.66,
0.0909,
154,
0,
1,
0,
0,
154,
0,
0
],
[
14,
0,
0.0305,
0.0076,
0,
... | [
"import io, re",
"import Global",
"flag_l = 0",
"tokensPath = './Tokens.txt'",
"def insertToQueue(s1, s2, s3):\n Global.lexical_queue.append(s1)\n Global.symbol_queue.append(s2)\n Global.semantics_queue.append(s3)",
" Global.lexical_queue.append(s1)",
" Global.symbol_queue.append(s2)",
... |
import datetime, sys
import Global, Lexical, Parser, Semantics, Pragmatics
testDataPath = './Parser_Test_Data.txt'
#testDataErrorPath = './Parser_Test_Data_Error.txt'
outputPath = './output.txt'
if len(sys.argv) == 3 :
testDataPath = sys.argv[1]
outputPath = sys.argv[2];
testDataFile = open(testDataPath, 'r'... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
426,
0,
2,
0,
0,
426,
0,
0
],
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0.0833,
154,
0,
5,
0,
0,
154,
0,
0
],
[
14,
0,
0.1667,
0.0417,
0,
... | [
"import datetime, sys",
"import Global, Lexical, Parser, Semantics, Pragmatics",
"testDataPath = './Parser_Test_Data.txt'",
"outputPath = './output.txt'",
"if len(sys.argv) == 3 :\n testDataPath = sys.argv[1]\n outputPath = sys.argv[2];",
" testDataPath = sys.argv[1]",
" outputPath = sys.arg... |
import io, re, string
from collections import deque
import Global,Semantics
matrixPath = './Matrix.txt'
reductionPath = './Reduction.txt'
flag_insert = 0
matrix = []
reductions = []
def pushStack():
Global.syntax_stack.append(Global.lexical_queue.popleft())
Global.symbol_stack.append(Global.symbol_queue.popl... | [
[
1,
0,
0.0064,
0.0064,
0,
0.66,
0,
518,
0,
3,
0,
0,
518,
0,
0
],
[
1,
0,
0.0127,
0.0064,
0,
0.66,
0.05,
193,
0,
1,
0,
0,
193,
0,
0
],
[
1,
0,
0.0191,
0.0064,
0,
0.... | [
"import io, re, string",
"from collections import deque",
"import Global,Semantics",
"matrixPath = './Matrix.txt'",
"reductionPath = './Reduction.txt'",
"flag_insert = 0",
"matrix = []",
"reductions = []",
"def pushStack():\n Global.syntax_stack.append(Global.lexical_queue.popleft())\n Global.... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/env python
#text = None
#name = '/opt/local/include/curl/curl.h'
#name = '/usr/include/curl/curl.h'
#f = open(name)
#text = f.read()
#f.close();
import sys
text = sys.stdin.read()
import re
longargs = [];
objargs = [];
fnargs = [];
print "static JSConstDoubleSpec easycurl_options[] = {"
for mo in re.fin... | [
[
1,
0,
0.3056,
0.0278,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.3333,
0.0278,
0,
0.66,
0.1429,
439,
3,
0,
0,
0,
453,
10,
1
],
[
1,
0,
0.3611,
0.0278,
0,
... | [
"import sys",
"text = sys.stdin.read()",
"import re",
"longargs = [];",
"objargs = [];",
"fnargs = [];",
"print(\"static JSConstDoubleSpec easycurl_options[] = {\")",
"for mo in re.finditer(r'CINIT.([A-Z_]+), *([A-Z]+), *([0-9]+)', text):\n val = int(mo.group(3))\n t = mo.group(2)\n\n if t ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.0'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 1.0
'''
try:
import json
except ImportError:
import simplejson as json
import time
import hmac
import uuid
import base64
import urllib
impo... | [
[
14,
0,
0.0113,
0.0028,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0142,
0.0028,
0,
0.66,
0.0303,
777,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.0227,
0.0085,
0,
0.... | [
"__version__ = '1.0'",
"__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'",
"'''\nPython client SDK for sina weibo API using OAuth 1.0\n'''",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
" import simplejson as json",
"import time",
"import hmac",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.04'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 2.
'''
try:
import json
except ImportError:
import simplejson as json
import time
import urllib
import urllib2
import logging
def _obj_ho... | [
[
14,
0,
0.0201,
0.005,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0251,
0.005,
0,
0.66,
0.0435,
777,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.0402,
0.0151,
0,
0.66... | [
"__version__ = '1.04'",
"__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'",
"'''\nPython client SDK for sina weibo API using OAuth 2.\n'''",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
" import simplejson as json",
"import time",
"import urllib"... |
# mako/codegen.py
# Copyright (C) 2006-2011 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module source code."""
impo... | [
[
8,
0,
0.0067,
0.001,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0086,
0.001,
0,
0.66,
0.1111,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0095,
0.001,
0,
0.66,
... | [
"\"\"\"provides functionality for rendering a parsetree constructing into module source code.\"\"\"",
"import time",
"import re",
"from mako.pygen import PythonPrinter",
"from mako import util, ast, parsetree, filters, exceptions",
"MAGIC_NUMBER = 6",
"def compile(node, \n uri, \n ... |
# mako/pygen.py
# Copyright (C) 2006-2011 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""utilities for generating and formatting literal Python code."""
import re, string
from StringIO ... | [
[
8,
0,
0.0246,
0.0035,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0316,
0.0035,
0,
0.66,
0.2,
540,
0,
2,
0,
0,
540,
0,
0
],
[
1,
0,
0.0351,
0.0035,
0,
0.66,
... | [
"\"\"\"utilities for generating and formatting literal Python code.\"\"\"",
"import re, string",
"from StringIO import StringIO",
"from mako import exceptions",
"class PythonPrinter(object):\n def __init__(self, stream):\n # indentation counter\n self.indent = 0\n \n # a stack storin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.