code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0,
192,
0,
1,
0,
0,
192,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.0385,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
... | [
"import cvarray",
"import mp_map",
"import prog_bar",
"import numpy_help_cpp",
"import python_obj_cpp",
"import matrix_cpp",
"import gamma_cpp",
"import setProcName",
"import start_cpp",
"import make",
"import doc_gen",
"doc = doc_gen.DocGen('utils', 'Utilities/Miscellaneous', 'Library of misc... |
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0818,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0881,
0.0063,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0943,
0.0063,
0,
0.... | [
"import unittest",
"import random",
"import math",
"from scipy.special import gammaln, psi, polygamma",
"from scipy import weave",
"from utils.start_cpp import start_cpp",
"gamma_code = start_cpp() + \"\"\"\n#ifndef GAMMA_CODE\n#define GAMMA_CODE\n\n#include <cmath>\n\n// Returns the natural logarithm o... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.5,
0.0333,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.5333,
0.0333,
0,
0.66,
0.5,
154,
0,
1,
0,
0,
154,
0,
0
],
[
2,
0,
0.8333,
0.3667,
0,
0.66,
... | [
"import inspect",
"import hashlib",
"def start_cpp(hash_str = None):\n \"\"\"This method does two things - firstly it adds the correct line numbers to scipy.weave code (Good for debugging) and secondly it can optionaly inserts a hash code of some other code into the code. This latter feature is useful for work... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
0.6... | [
"import sys",
"import os.path",
"import tempfile",
"import shutil",
"from distutils.core import setup, Extension",
"import distutils.ccompiler",
"import distutils.dep_util",
"try:\n __default_compiler = distutils.ccompiler.new_compiler()\nexcept:\n __default_compiler = None",
" __default_compiler... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0634,
0.0049,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0683,
0.0049,
0,
0.66,
0.5,
878,
0,
1,
0,
0,
878,
0,
0
],
[
3,
0,
0.5439,
0.9171,
0,
0.6... | [
"import pydoc",
"import inspect",
"class DocGen:\n \"\"\"A helper class that is used to generate documentation for the system. Outputs multiple formats simultaneously, specifically html for local reading with a webbrowser and the markup used by the wiki system on Google code.\"\"\"\n def __init__(self, name, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.3636,
0.0227,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
2,
0,
0.5682,
0.25,
0,
0.66,
0.5,
903,
0,
1,
0,
0,
0,
0,
9
],
[
8,
1,
0.4773,
0.0227,
1,
0.52,
... | [
"from ctypes import *",
"def setProcName(name):\n \"\"\"Sets the process name, linux only - useful for those programs where you might want to do a killall, but don't want to slaughter all the other python processes. Note that there are multiple mechanisms, and that the given new name can be shortened by differin... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1456,
0.0097,
0,
0.66,
0,
901,
0,
1,
0,
0,
901,
0,
0
],
[
1,
0,
0.1553,
0.0097,
0,
0.66,
0.1111,
99,
0,
1,
0,
0,
99,
0,
0
],
[
1,
0,
0.1748,
0.0097,
0,
0.... | [
"import multiprocessing as mp",
"import multiprocessing.synchronize # To make sure we have all the functionality.",
"import types",
"import marshal",
"import unittest",
"def repeat(x):\n \"\"\"A generator that repeats the input forever - can be used with the mp_map function to give data to a function tha... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0,
192,
0,
1,
0,
0,
192,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.0385,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
... | [
"import cvarray",
"import mp_map",
"import prog_bar",
"import numpy_help_cpp",
"import python_obj_cpp",
"import matrix_cpp",
"import gamma_cpp",
"import setProcName",
"import start_cpp",
"import make",
"import doc_gen",
"doc = doc_gen.DocGen('utils', 'Utilities/Miscellaneous', 'Library of misc... |
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0818,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0881,
0.0063,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0943,
0.0063,
0,
0.... | [
"import unittest",
"import random",
"import math",
"from scipy.special import gammaln, psi, polygamma",
"from scipy import weave",
"from utils.start_cpp import start_cpp",
"gamma_code = start_cpp() + \"\"\"\n#ifndef GAMMA_CODE\n#define GAMMA_CODE\n\n#include <cmath>\n\n// Returns the natural logarithm o... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.5,
0.0333,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.5333,
0.0333,
0,
0.66,
0.5,
154,
0,
1,
0,
0,
154,
0,
0
],
[
2,
0,
0.8333,
0.3667,
0,
0.66,
... | [
"import inspect",
"import hashlib",
"def start_cpp(hash_str = None):\n \"\"\"This method does two things - firstly it adds the correct line numbers to scipy.weave code (Good for debugging) and secondly it can optionaly inserts a hash code of some other code into the code. This latter feature is useful for work... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
0.6... | [
"import sys",
"import os.path",
"import tempfile",
"import shutil",
"from distutils.core import setup, Extension",
"import distutils.ccompiler",
"import distutils.dep_util",
"try:\n __default_compiler = distutils.ccompiler.new_compiler()\nexcept:\n __default_compiler = None",
" __default_compiler... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0634,
0.0049,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0683,
0.0049,
0,
0.66,
0.5,
878,
0,
1,
0,
0,
878,
0,
0
],
[
3,
0,
0.5439,
0.9171,
0,
0.6... | [
"import pydoc",
"import inspect",
"class DocGen:\n \"\"\"A helper class that is used to generate documentation for the system. Outputs multiple formats simultaneously, specifically html for local reading with a webbrowser and the markup used by the wiki system on Google code.\"\"\"\n def __init__(self, name, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.3636,
0.0227,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
2,
0,
0.5682,
0.25,
0,
0.66,
0.5,
903,
0,
1,
0,
0,
0,
0,
9
],
[
8,
1,
0.4773,
0.0227,
1,
0.22,
... | [
"from ctypes import *",
"def setProcName(name):\n \"\"\"Sets the process name, linux only - useful for those programs where you might want to do a killall, but don't want to slaughter all the other python processes. Note that there are multiple mechanisms, and that the given new name can be shortened by differin... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1456,
0.0097,
0,
0.66,
0,
901,
0,
1,
0,
0,
901,
0,
0
],
[
1,
0,
0.1553,
0.0097,
0,
0.66,
0.1111,
99,
0,
1,
0,
0,
99,
0,
0
],
[
1,
0,
0.1748,
0.0097,
0,
0.... | [
"import multiprocessing as mp",
"import multiprocessing.synchronize # To make sure we have all the functionality.",
"import types",
"import marshal",
"import unittest",
"def repeat(x):\n \"\"\"A generator that repeats the input forever - can be used with the mp_map function to give data to a function tha... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0,
192,
0,
1,
0,
0,
192,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.0385,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
... | [
"import cvarray",
"import mp_map",
"import prog_bar",
"import numpy_help_cpp",
"import python_obj_cpp",
"import matrix_cpp",
"import gamma_cpp",
"import setProcName",
"import start_cpp",
"import make",
"import doc_gen",
"doc = doc_gen.DocGen('utils', 'Utilities/Miscellaneous', 'Library of misc... |
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0818,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0881,
0.0063,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0943,
0.0063,
0,
0.... | [
"import unittest",
"import random",
"import math",
"from scipy.special import gammaln, psi, polygamma",
"from scipy import weave",
"from utils.start_cpp import start_cpp",
"gamma_code = start_cpp() + \"\"\"\n#ifndef GAMMA_CODE\n#define GAMMA_CODE\n\n#include <cmath>\n\n// Returns the natural logarithm o... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.5,
0.0333,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.5333,
0.0333,
0,
0.66,
0.5,
154,
0,
1,
0,
0,
154,
0,
0
],
[
2,
0,
0.8333,
0.3667,
0,
0.66,
... | [
"import inspect",
"import hashlib",
"def start_cpp(hash_str = None):\n \"\"\"This method does two things - firstly it adds the correct line numbers to scipy.weave code (Good for debugging) and secondly it can optionaly inserts a hash code of some other code into the code. This latter feature is useful for work... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
0.6... | [
"import sys",
"import os.path",
"import tempfile",
"import shutil",
"from distutils.core import setup, Extension",
"import distutils.ccompiler",
"import distutils.dep_util",
"try:\n __default_compiler = distutils.ccompiler.new_compiler()\nexcept:\n __default_compiler = None",
" __default_compiler... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0634,
0.0049,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0683,
0.0049,
0,
0.66,
0.5,
878,
0,
1,
0,
0,
878,
0,
0
],
[
3,
0,
0.5439,
0.9171,
0,
0.6... | [
"import pydoc",
"import inspect",
"class DocGen:\n \"\"\"A helper class that is used to generate documentation for the system. Outputs multiple formats simultaneously, specifically html for local reading with a webbrowser and the markup used by the wiki system on Google code.\"\"\"\n def __init__(self, name, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.3636,
0.0227,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
2,
0,
0.5682,
0.25,
0,
0.66,
0.5,
903,
0,
1,
0,
0,
0,
0,
9
],
[
8,
1,
0.4773,
0.0227,
1,
0.98,
... | [
"from ctypes import *",
"def setProcName(name):\n \"\"\"Sets the process name, linux only - useful for those programs where you might want to do a killall, but don't want to slaughter all the other python processes. Note that there are multiple mechanisms, and that the given new name can be shortened by differin... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1456,
0.0097,
0,
0.66,
0,
901,
0,
1,
0,
0,
901,
0,
0
],
[
1,
0,
0.1553,
0.0097,
0,
0.66,
0.1111,
99,
0,
1,
0,
0,
99,
0,
0
],
[
1,
0,
0.1748,
0.0097,
0,
0.... | [
"import multiprocessing as mp",
"import multiprocessing.synchronize # To make sure we have all the functionality.",
"import types",
"import marshal",
"import unittest",
"def repeat(x):\n \"\"\"A generator that repeats the input forever - can be used with the mp_map function to give data to a function tha... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0,
192,
0,
1,
0,
0,
192,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.0385,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
... | [
"import cvarray",
"import mp_map",
"import prog_bar",
"import numpy_help_cpp",
"import python_obj_cpp",
"import matrix_cpp",
"import gamma_cpp",
"import setProcName",
"import start_cpp",
"import make",
"import doc_gen",
"doc = doc_gen.DocGen('utils', 'Utilities/Miscellaneous', 'Library of misc... |
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0818,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0881,
0.0063,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0943,
0.0063,
0,
0.... | [
"import unittest",
"import random",
"import math",
"from scipy.special import gammaln, psi, polygamma",
"from scipy import weave",
"from utils.start_cpp import start_cpp",
"gamma_code = start_cpp() + \"\"\"\n#ifndef GAMMA_CODE\n#define GAMMA_CODE\n\n#include <cmath>\n\n// Returns the natural logarithm o... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.5,
0.0333,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.5333,
0.0333,
0,
0.66,
0.5,
154,
0,
1,
0,
0,
154,
0,
0
],
[
2,
0,
0.8333,
0.3667,
0,
0.66,
... | [
"import inspect",
"import hashlib",
"def start_cpp(hash_str = None):\n \"\"\"This method does two things - firstly it adds the correct line numbers to scipy.weave code (Good for debugging) and secondly it can optionaly inserts a hash code of some other code into the code. This latter feature is useful for work... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
0.6... | [
"import sys",
"import os.path",
"import tempfile",
"import shutil",
"from distutils.core import setup, Extension",
"import distutils.ccompiler",
"import distutils.dep_util",
"try:\n __default_compiler = distutils.ccompiler.new_compiler()\nexcept:\n __default_compiler = None",
" __default_compiler... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0634,
0.0049,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0683,
0.0049,
0,
0.66,
0.5,
878,
0,
1,
0,
0,
878,
0,
0
],
[
3,
0,
0.5439,
0.9171,
0,
0.6... | [
"import pydoc",
"import inspect",
"class DocGen:\n \"\"\"A helper class that is used to generate documentation for the system. Outputs multiple formats simultaneously, specifically html for local reading with a webbrowser and the markup used by the wiki system on Google code.\"\"\"\n def __init__(self, name, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.3636,
0.0227,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
2,
0,
0.5682,
0.25,
0,
0.66,
0.5,
903,
0,
1,
0,
0,
0,
0,
9
],
[
8,
1,
0.4773,
0.0227,
1,
0.95,
... | [
"from ctypes import *",
"def setProcName(name):\n \"\"\"Sets the process name, linux only - useful for those programs where you might want to do a killall, but don't want to slaughter all the other python processes. Note that there are multiple mechanisms, and that the given new name can be shortened by differin... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1456,
0.0097,
0,
0.66,
0,
901,
0,
1,
0,
0,
901,
0,
0
],
[
1,
0,
0.1553,
0.0097,
0,
0.66,
0.1111,
99,
0,
1,
0,
0,
99,
0,
0
],
[
1,
0,
0.1748,
0.0097,
0,
0.... | [
"import multiprocessing as mp",
"import multiprocessing.synchronize # To make sure we have all the functionality.",
"import types",
"import marshal",
"import unittest",
"def repeat(x):\n \"\"\"A generator that repeats the input forever - can be used with the mp_map function to give data to a function tha... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0,
192,
0,
1,
0,
0,
192,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.0385,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
... | [
"import cvarray",
"import mp_map",
"import prog_bar",
"import numpy_help_cpp",
"import python_obj_cpp",
"import matrix_cpp",
"import gamma_cpp",
"import setProcName",
"import start_cpp",
"import make",
"import doc_gen",
"doc = doc_gen.DocGen('utils', 'Utilities/Miscellaneous', 'Library of misc... |
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0818,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0881,
0.0063,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0943,
0.0063,
0,
0.... | [
"import unittest",
"import random",
"import math",
"from scipy.special import gammaln, psi, polygamma",
"from scipy import weave",
"from utils.start_cpp import start_cpp",
"gamma_code = start_cpp() + \"\"\"\n#ifndef GAMMA_CODE\n#define GAMMA_CODE\n\n#include <cmath>\n\n// Returns the natural logarithm o... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.5,
0.0333,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.5333,
0.0333,
0,
0.66,
0.5,
154,
0,
1,
0,
0,
154,
0,
0
],
[
2,
0,
0.8333,
0.3667,
0,
0.66,
... | [
"import inspect",
"import hashlib",
"def start_cpp(hash_str = None):\n \"\"\"This method does two things - firstly it adds the correct line numbers to scipy.weave code (Good for debugging) and secondly it can optionaly inserts a hash code of some other code into the code. This latter feature is useful for work... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
0.6... | [
"import sys",
"import os.path",
"import tempfile",
"import shutil",
"from distutils.core import setup, Extension",
"import distutils.ccompiler",
"import distutils.dep_util",
"try:\n __default_compiler = distutils.ccompiler.new_compiler()\nexcept:\n __default_compiler = None",
" __default_compiler... |
# Copyright (c) 2012, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo... | [
[
1,
0,
0.0634,
0.0049,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0683,
0.0049,
0,
0.66,
0.5,
878,
0,
1,
0,
0,
878,
0,
0
],
[
3,
0,
0.5439,
0.9171,
0,
0.6... | [
"import pydoc",
"import inspect",
"class DocGen:\n \"\"\"A helper class that is used to generate documentation for the system. Outputs multiple formats simultaneously, specifically html for local reading with a webbrowser and the markup used by the wiki system on Google code.\"\"\"\n def __init__(self, name, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrig... | [
[
1,
0,
0.3636,
0.0227,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
2,
0,
0.5682,
0.25,
0,
0.66,
0.5,
903,
0,
1,
0,
0,
0,
0,
9
],
[
8,
1,
0.4773,
0.0227,
1,
0.09,
... | [
"from ctypes import *",
"def setProcName(name):\n \"\"\"Sets the process name, linux only - useful for those programs where you might want to do a killall, but don't want to slaughter all the other python processes. Note that there are multiple mechanisms, and that the given new name can be shortened by differin... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1456,
0.0097,
0,
0.66,
0,
901,
0,
1,
0,
0,
901,
0,
0
],
[
1,
0,
0.1553,
0.0097,
0,
0.66,
0.1111,
99,
0,
1,
0,
0,
99,
0,
0
],
[
1,
0,
0.1748,
0.0097,
0,
0.... | [
"import multiprocessing as mp",
"import multiprocessing.synchronize # To make sure we have all the functionality.",
"import types",
"import marshal",
"import unittest",
"def repeat(x):\n \"\"\"A generator that repeats the input forever - can be used with the mp_map function to give data to a function tha... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Tom SF Haines
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of... | [
[
1,
0,
0.1923,
0.0128,
0,
0.66,
0,
972,
0,
1,
0,
0,
972,
0,
0
],
[
14,
0,
0.6282,
0.7564,
0,
0.66,
1,
799,
4,
0,
0,
0,
0,
0,
1
]
] | [
"from utils.start_cpp import start_cpp",
"numpy_util_code = start_cpp() + \"\"\"\n#ifndef NUMPY_UTIL_CODE\n#define NUMPY_UTIL_CODE\n\nfloat & Float1D(PyArrayObject * arr, int index = 0)\n{\n return *(float*)(arr->data + index*arr->strides[0]);\n}"
] |
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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 agre... | [
[
1,
0,
0.071,
0.0055,
0,
0.66,
0,
206,
0,
1,
0,
0,
206,
0,
0
],
[
1,
0,
0.0765,
0.0055,
0,
0.66,
0.25,
206,
0,
1,
0,
0,
206,
0,
0
],
[
1,
0,
0.0874,
0.0055,
0,
0.6... | [
"from params import Kernel",
"from params import Params",
"from copy import copy",
"class ParamsRange:\n \"\"\"A parameters object where each variable takes a list rather than a single value - it then pretends to be a list of Params objects, which consists of every combination implied by the ranges.\"\"\"\n ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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... | [
[
1,
0,
0.3684,
0.0263,
0,
0.66,
0,
75,
0,
1,
0,
0,
75,
0,
0
],
[
1,
0,
0.4211,
0.0263,
0,
0.66,
0.0769,
970,
0,
1,
0,
0,
970,
0,
0
],
[
14,
0,
0.5526,
0.0263,
0,
0... | [
"import svm",
"from utils import doc_gen",
"doc = doc_gen.DocGen('svm', 'Support Vector Machine', 'Support vector machines, classification only')",
"doc.addFile('readme.txt', 'Overview')",
"doc.addFunction(svm.solvePair)",
"doc.addFunction(svm.looPair)",
"doc.addFunction(svm.looPairSelect)",
"doc.addC... |
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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 agre... | [
[
1,
0,
0.1161,
0.0089,
0,
0.66,
0,
105,
0,
1,
0,
0,
105,
0,
0
],
[
1,
0,
0.1339,
0.0089,
0,
0.66,
0.1667,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.1429,
0.0089,
0,
... | [
"from smo import SMO",
"import copy",
"import numpy",
"def looPair(params,data):\n \"\"\"Given a parameters object and a pair of data matrix and y (As returned by dataset.getTrainData.) this returns a (good) approximation of the leave one out negative log likellihood, and a model trained on *all* the data as... |
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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 agre... | [
[
14,
0,
0.2006,
0.2222,
0,
0.66,
0,
364,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6667,
0.6728,
0,
0.66,
1,
902,
1,
0,
0,
0,
0,
3,
0
]
] | [
"cacheCode = \"\"\"\n// Right now only provides the most basic of caching, by pre-caclulating the diagonal, which is admitedly used very heavilly...\nnpy_intp * dmSize;\ndouble * dm;\ndouble * diagBuff;\n\nvoid cacheBegin(npy_intp * dmSizeIn, double * dmIn)\n{",
"smoCoreCode = \"\"\"\n// Constant...\n const doubl... |
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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 agre... | [
[
1,
0,
0.3514,
0.027,
0,
0.66,
0,
206,
0,
1,
0,
0,
206,
0,
0
],
[
1,
0,
0.3784,
0.027,
0,
0.66,
0.0833,
206,
0,
1,
0,
0,
206,
0,
0
],
[
1,
0,
0.4054,
0.027,
0,
0.6... | [
"from params import Kernel",
"from params import Params",
"from params_sets import ParamsRange",
"from params_sets import ParamsSet",
"from dataset import Dataset",
"from model import Model",
"from loo import looPair",
"from loo import looPairRange",
"from loo import looPairBrute",
"from loo impor... |
# -*- coding: utf-8 -*-
| [] | [] |
# -*- coding: utf-8 -*-
# Copyright 2010 Tom SF Haines
# 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 agre... | [
[
1,
0,
0.0909,
0.007,
0,
0.66,
0,
206,
0,
1,
0,
0,
206,
0,
0
],
[
1,
0,
0.0979,
0.007,
0,
0.66,
0.2,
699,
0,
1,
0,
0,
699,
0,
0
],
[
1,
0,
0.1049,
0.007,
0,
0.66,
... | [
"from params import *",
"from smo_aux import *",
"from model import *",
"import numpy",
"from scipy.weave import inline",
"class SMO:\n \"\"\"Implimentation of the 'Sequential Minimal Optimization' SVM solving method of Platt, using the WSS 3 pair selection method of Fan, Chen and Lin. This just solves f... |
Import('file_list')
my_list = Split("""
""")
for x in range(len(my_list)):
my_list[x] = 'palettes/' + my_list[x]
file_list = my_list + file_list
Export('file_list')
| [
[
8,
0,
0.1429,
0.1429,
0,
0.66,
0,
248,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3571,
0.2857,
0,
0.66,
0.25,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.6429,
0.2857,
0,
0.... | [
"Import('file_list')",
"my_list = Split(\"\"\"\n\"\"\")",
"for x in range(len(my_list)):\n my_list[x] = 'palettes/' + my_list[x]",
" my_list[x] = 'palettes/' + my_list[x]",
"file_list = my_list + file_list",
"Export('file_list')"
] |
my_list = Split("""
""")
for x in range(len(my_list)):
my_list[x] = 'fir/' + my_list[x]
Return('my_list')
| [
[
14,
0,
0.25,
0.3333,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.75,
0.3333,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.8333,
0.1667,
1,
0.95,
... | [
"my_list = Split(\"\"\"\n\"\"\")",
"for x in range(len(my_list)):\n my_list[x] = 'fir/' + my_list[x]",
" my_list[x] = 'fir/' + my_list[x]",
"Return('my_list')"
] |
my_list = Split("""
01-222.cpp
103.cpp
106.cpp
108.cpp
112.cpp
117.cpp
120.cpp
121.cpp
15.cpp
164.cpp
175.cpp
176.cpp
177.cpp
178.cpp
179.cpp
183.cpp
185.cpp
186.cpp
187.cpp
189.cpp
199.cpp
208.cpp
222.cpp
23.cpp
235.cpp
253.cpp
3d-block.cpp
411120-c.cpp
43.cpp
57.cpp
603-5052.cpp
68.cpp
8157.cpp
8237.cpp
830118C.cpp
... | [
[
14,
0,
0.4835,
0.956,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.9835,
0.022,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.989,
0.011,
1,
0.26,
... | [
"my_list = Split(\"\"\"\n01-222.cpp\n103.cpp\n106.cpp\n108.cpp\n112.cpp\n117.cpp\n120.cpp",
"for x in range(len(my_list)):\n my_list[x] = 'boards/' + my_list[x]",
" my_list[x] = 'boards/' + my_list[x]",
"Return('my_list')"
] |
my_list = Split("""
151.cpp
16.cpp
17.cpp
18.cpp
193.cpp
201.cpp
202.cpp
203.cpp
204.cpp
212.cpp
213.cpp
214.cpp
215.cpp
217.cpp
21.cpp
225.cpp
227.cpp
228.cpp
229.cpp
22.cpp
230.cpp
231.cpp
232.cpp
234.cpp
241.cpp
242.cpp
244.cpp
246.cpp
24and26.cpp
255.cpp
25.cpp
27.cpp
32.cpp
33.cpp
40.cpp
41.cpp
42.cpp
46.cpp
50.... | [
[
14,
0,
0.48,
0.9467,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.98,
0.0267,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.9867,
0.0133,
1,
0.93,
... | [
"my_list = Split(\"\"\"\n151.cpp\n16.cpp\n17.cpp\n18.cpp\n193.cpp\n201.cpp\n202.cpp",
"for x in range(len(my_list)):\n my_list[x] = 'mappers/' + my_list[x]",
" my_list[x] = 'mappers/' + my_list[x]",
"Return('my_list')"
] |
my_list = Split("""
lapi.c
lauxlib.c
lbaselib.c
lcode.c
ldblib.c
ldebug.c
ldo.c
ldump.c
lfunc.c
lgc.c
linit.c
liolib.c
llex.c
lmathlib.c
lmem.c
loadlib.c
lobject.c
lopcodes.c
loslib.c
lparser.c
lstate.c
lstring.c
lstrlib.c
ltable.c
ltablib.c
ltm.c
lundump.c
lvm.c
lzio.c
print.c
""")
for ... | [
[
14,
0,
0.4583,
0.8889,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.9583,
0.0556,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.9722,
0.0278,
1,
0.... | [
"my_list = Split(\"\"\"\nlapi.c\nlauxlib.c\nlbaselib.c\nlcode.c\nldblib.c\nldebug.c\nldo.c",
"for x in range(len(my_list)):\n my_list[x] = 'lua/src/' + my_list[x]",
" my_list[x] = 'lua/src/' + my_list[x]",
"Return('my_list')"
] |
my_list = Split("""
nesvideos-piece.cpp
rgbtorgb.cpp
""")
Import('env')
if env['LOGO']:
env.Append(CCFLAGS = "-DHAVE_GD")
for x in range(len(my_list)):
my_list[x] = 'drivers/videolog/' + my_list[x]
Return('my_list')
| [
[
14,
0,
0.1786,
0.2857,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
8,
0,
0.4286,
0.0714,
0,
0.66,
0.25,
248,
3,
1,
0,
0,
0,
0,
1
],
[
4,
0,
0.6071,
0.1429,
0,
0.... | [
"my_list = Split(\"\"\"\nnesvideos-piece.cpp\nrgbtorgb.cpp\n\"\"\")",
"Import('env')",
"if env['LOGO']:\n env.Append(CCFLAGS = \"-DHAVE_GD\")",
" env.Append(CCFLAGS = \"-DHAVE_GD\")",
"for x in range(len(my_list)):\n my_list[x] = 'drivers/videolog/' + my_list[x]",
" my_list[x] = 'drivers/videolog/' + ... |
my_list = Split("""
args.cpp
cheat.cpp
config.cpp
hq2x.cpp
hq3x.cpp
scale2x.cpp
scale3x.cpp
scalebit.cpp
vidblit.cpp
configSys.cpp
nes_ntsc.c
""")
for x in range(len(my_list)):
my_list[x] = 'drivers/common/' + my_list[x]
Return('my_list')
| [
[
14,
0,
0.4118,
0.7647,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.9118,
0.1176,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.9412,
0.0588,
1,
0.... | [
"my_list = Split(\"\"\"\nargs.cpp\ncheat.cpp\nconfig.cpp\nhq2x.cpp\nhq3x.cpp\nscale2x.cpp\nscale3x.cpp",
"for x in range(len(my_list)):\n my_list[x] = 'drivers/common/' + my_list[x]",
" my_list[x] = 'drivers/common/' + my_list[x]",
"Return('my_list')"
] |
file_list = Split("""
asm.cpp
cart.cpp
cheat.cpp
conddebug.cpp
config.cpp
debug.cpp
drawing.cpp
emufile.cpp
fceu.cpp
fds.cpp
file.cpp
filter.cpp
ines.cpp
input.cpp
netplay.cpp
nsf.cpp
oldmovie.cpp
palette.cpp
ppu.cpp
sound.cpp
state.cpp
unif.cpp
video.cpp
vsuni.cpp
wave.cpp
x6502.cpp
movie.cpp
""")
subdirs = Split("... | [
[
14,
0,
0.2239,
0.4328,
0,
0.66,
0,
105,
3,
1,
0,
0,
551,
10,
1
],
[
14,
0,
0.5224,
0.1343,
0,
0.66,
0.1,
536,
3,
1,
0,
0,
551,
10,
1
],
[
8,
0,
0.6269,
0.0149,
0,
... | [
"file_list = Split(\"\"\"\nasm.cpp\ncart.cpp\ncheat.cpp\nconddebug.cpp\nconfig.cpp\ndebug.cpp\ndrawing.cpp",
"subdirs = Split(\"\"\"\nboards\ndrivers/common\nfir\ninput\nutils\nmappers\nlua",
"Import('env')",
"Export('env')",
"if env['LUA']:\n file_list.append('lua-engine.cpp')",
" file_list.append('lua... |
my_list = Split("""
arkanoid.cpp
bworld.cpp
cursor.cpp
fkb.cpp
ftrainer.cpp
hypershot.cpp
mahjong.cpp
mouse.cpp
oekakids.cpp
powerpad.cpp
quiz.cpp
shadow.cpp
suborkb.cpp
toprider.cpp
zapper.cpp
""")
for x in range(len(my_list)):
my_list[x] = 'input/' + my_list[x]
Return('my_list')
| [
[
14,
0,
0.4286,
0.8095,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.9286,
0.0952,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.9524,
0.0476,
1,
0.... | [
"my_list = Split(\"\"\"\narkanoid.cpp\nbworld.cpp\ncursor.cpp\nfkb.cpp\nftrainer.cpp\nhypershot.cpp\nmahjong.cpp",
"for x in range(len(my_list)):\n my_list[x] = 'input/' + my_list[x]",
" my_list[x] = 'input/' + my_list[x]",
"Return('my_list')"
] |
my_list = Split("""
crc32.cpp
endian.cpp
general.cpp
guid.cpp
md5.cpp
memory.cpp
unzip.cpp
xstring.cpp
""")
for x in range(len(my_list)):
my_list[x] = 'utils/' + my_list[x]
Return('my_list')
| [
[
14,
0,
0.3929,
0.7143,
0,
0.66,
0,
567,
3,
1,
0,
0,
551,
10,
1
],
[
6,
0,
0.8929,
0.1429,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.9286,
0.0714,
1,
0.... | [
"my_list = Split(\"\"\"\ncrc32.cpp\nendian.cpp\ngeneral.cpp\nguid.cpp\nmd5.cpp\nmemory.cpp\nunzip.cpp",
"for x in range(len(my_list)):\n my_list[x] = 'utils/' + my_list[x]",
" my_list[x] = 'utils/' + my_list[x]",
"Return('my_list')"
] |
import jsonrpclib
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
import threading
import sys
import random
class Bike:
def __init__(self,id=0,ip="0.0.0.0",port=6969,localisation=[0,0,0,0]):
self.id= id
self.ip = ip
self.port = port
self.localisation = localisation
... | [
[
1,
0,
0.0073,
0.0073,
0,
0.66,
0,
274,
0,
1,
0,
0,
274,
0,
0
],
[
1,
0,
0.0146,
0.0073,
0,
0.66,
0.0769,
221,
0,
1,
0,
0,
221,
0,
0
],
[
1,
0,
0.0219,
0.0073,
0,
... | [
"import jsonrpclib",
"from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer",
"import threading",
"import sys",
"import random",
"class Bike:\n def __init__(self,id=0,ip=\"0.0.0.0\",port=6969,localisation=[0,0,0,0]):\n self.id= id\n self.ip = ip\n self.port = port\n ... |
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
import jsonrpclib
import RPIO as GPIO
import time
import threading
import random
id = 42
def set_id(arg_id):
id = arg_id
def unlock_bike(unlock_time):
print "Unlocking bike for %i seconds!" %unlock_time
GPIO.output(17, False)
time.sleep(unlock_time... | [
[
1,
0,
0.0145,
0.0145,
0,
0.66,
0,
221,
0,
1,
0,
0,
221,
0,
0
],
[
1,
0,
0.029,
0.0145,
0,
0.66,
0.0312,
274,
0,
1,
0,
0,
274,
0,
0
],
[
1,
0,
0.0435,
0.0145,
0,
0... | [
"from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer",
"import jsonrpclib",
"import RPIO as GPIO",
"import time",
"import threading",
"import random",
"id = 42",
"def set_id(arg_id):\n id = arg_id",
" id = arg_id",
"def unlock_bike(unlock_time):\n\tprint(\"Unlocking bike for %i se... |
#!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've custo... | [
[
1,
0,
0.1429,
0.0714,
0,
0.66,
0,
879,
0,
1,
0,
0,
879,
0,
0
],
[
1,
0,
0.2143,
0.0714,
0,
0.66,
0.25,
201,
0,
1,
0,
0,
201,
0,
0
],
[
7,
0,
0.4643,
0.4286,
0,
0.... | [
"from django.core.management import execute_manager",
"import imp",
"try:\n imp.find_module('settings') # Assumed to be in the same directory.\nexcept ImportError:\n import sys\n sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized thi... |
from django.conf.urls.defaults import patterns, include, url
#Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
('^$' , home_page),
('^hello/$', hello),
(r'^time/plus/(\d{1,2})/$', hours_... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
341,
0,
3,
0,
0,
341,
0,
0
],
[
14,
0,
0.6562,
0.75,
0,
0.66,
1,
990,
3,
5,
0,
0,
75,
10,
3
]
] | [
"from django.conf.urls.defaults import patterns, include, url",
"urlpatterns = patterns('',\n # Examples:\n ('^$' , home_page), \n ('^hello/$', hello),\n (r'^time/plus/(\\d{1,2})/$', hours_ahead),\n\n #Uncomment the admin/doc line below to enable admin documentation:\n # url(r... |
# Django settings for nut project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | [
[
14,
0,
0.0207,
0.0069,
0,
0.66,
0,
309,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.0276,
0.0069,
0,
0.66,
0.0435,
7,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0483,
0.0207,
0,
0.6... | [
"DEBUG = True",
"TEMPLATE_DEBUG = DEBUG",
"ADMINS = (\n # ('Your Name', 'your_email@example.com'),\n)",
"MANAGERS = ADMINS",
"DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.\n 'NAME': '', ... |
import datetime
from django.template.loader import get_template
from django.shortcuts import render_to_response #shorttest solution for return
def home_page(request):
return render_to_response('link.html')
def hello(request):
return HttpResponse("Hello world")
def hours_ahead(request, offset):
... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.1053,
0.0526,
0,
0.66,
0.2,
970,
0,
1,
0,
0,
970,
0,
0
],
[
1,
0,
0.1579,
0.0526,
0,
0.6... | [
"import datetime",
"from django.template.loader import get_template",
"from django.shortcuts import render_to_response #shorttest solution for return",
"def home_page(request):\n return render_to_response('link.html')",
" return render_to_response('link.html')",
"def hello(request):\n return Htt... |
#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.96,
... | [
"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
# ledMap = [1,2,3,4,5,6,7,8,9,10] #mapped LEDs
def __init__(self, _host, _port, _ledMap):
self.host = _host
self.port = _port
self.ledM... | [
[
1,
0,
0.0093,
0.0093,
0,
0.66,
0,
687,
0,
5,
0,
0,
687,
0,
0
],
[
3,
0,
0.5093,
0.972,
0,
0.66,
1,
635,
0,
17,
0,
0,
0,
0,
49
],
[
2,
1,
0.0981,
0.0374,
1,
0.73,
... | [
"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#\tledMap = [1,2,3,4,5,6,7,8,9,10] \t#mapped LEDs\n\t\n\tdef __init__(self, _host, _port, _ledMap):\n\t\tself.host = _host",
"\tdef __init_... |
#!/usr/bin/env python
#
# This tool is copyright (c) 2006, Sean Estabrooks.
# It is released under the Gnu Public License, version 2.
#
# Import Perforce branches into Git repositories.
# Checking out the files is done by calling the standard p4
# client which you must have properly configured yourself
#
import marsha... | [
[
1,
0,
0.0306,
0.0028,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0333,
0.0028,
0,
0.66,
0.0256,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0361,
0.0028,
0,
... | [
"import marshal",
"import os",
"import sys",
"import time",
"import getopt",
"from signal import signal, \\\n SIGPIPE, SIGINT, SIG_DFL, \\\n default_int_handler",
"signal(SIGPIPE, SIG_DFL)",
"s = signal(SIGINT, SIG_DFL)",
"if s != default_int_handler:\n signal(SIGINT, s)",
" signal(SIGINT,... |
#!/usr/bin/env python
## zip archive frontend for git-fast-import
##
## For example:
##
## mkdir project; cd project; git init
## python import-zips.py *.zip
## git log --stat import-zips
from os import popen, path
from sys import argv, exit
from time import mktime
from zipfile import ZipFile
if len(argv) < 2:
p... | [
[
1,
0,
0.1507,
0.0137,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1644,
0.0137,
0,
0.66,
0.0909,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.1781,
0.0137,
0,
... | [
"from os import popen, path",
"from sys import argv, exit",
"from time import mktime",
"from zipfile import ZipFile",
"if len(argv) < 2:\n\tprint('Usage:', argv[0], '<zipfile>...')\n\texit(1)",
"\tprint('Usage:', argv[0], '<zipfile>...')",
"\texit(1)",
"branch_ref = 'refs/heads/import-zips'",
"commi... |
#!/usr/bin/env python
"""Distutils build/install script for the git_remote_helpers package."""
from distutils.core import setup
setup(
name = 'git_remote_helpers',
version = '0.1.0',
description = 'Git remote helper program for non-git repositories',
license = 'GPLv2',
author = 'The Git Community... | [
[
8,
0,
0.1765,
0.0588,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2941,
0.0588,
0,
0.66,
0.5,
152,
0,
1,
0,
0,
152,
0,
0
],
[
8,
0,
0.7059,
0.6471,
0,
0.66,
... | [
"\"\"\"Distutils build/install script for the git_remote_helpers package.\"\"\"",
"from distutils.core import setup",
"setup(\n name = 'git_remote_helpers',\n version = '0.1.0',\n description = 'Git remote helper program for non-git repositories',\n license = 'GPLv2',\n author = 'The Git Communit... |
import os
import subprocess
import sys
from git_remote_helpers.util import check_call
class GitExporter(object):
"""An exporter for testgit repositories.
The exporter simply delegates to git fast-export.
"""
def __init__(self, repo):
"""Creates a new exporter for the specified repo.
... | [
[
1,
0,
0.0172,
0.0172,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0345,
0.0172,
0,
0.66,
0.25,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0517,
0.0172,
0,
0.... | [
"import os",
"import subprocess",
"import sys",
"from git_remote_helpers.util import check_call",
"class GitExporter(object):\n \"\"\"An exporter for testgit repositories.\n\n The exporter simply delegates to git fast-export.\n \"\"\"\n\n def __init__(self, repo):\n \"\"\"Creates a new ex... |
import os
import subprocess
from git_remote_helpers.util import check_call, die, warn
class NonLocalGit(object):
"""Handler to interact with non-local repos.
"""
def __init__(self, repo):
"""Creates a new non-local handler for the specified repo.
"""
self.repo = repo
def cl... | [
[
1,
0,
0.0164,
0.0164,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0328,
0.0164,
0,
0.66,
0.3333,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0656,
0.0164,
0,
... | [
"import os",
"import subprocess",
"from git_remote_helpers.util import check_call, die, warn",
"class NonLocalGit(object):\n \"\"\"Handler to interact with non-local repos.\n \"\"\"\n\n def __init__(self, repo):\n \"\"\"Creates a new non-local handler for the specified repo.\n \"\"\"",
... |
#!/usr/bin/env python
"""Functionality for interacting with Git repositories.
This module provides classes for interfacing with a Git repository.
"""
import os
import re
import time
from binascii import hexlify
from cStringIO import StringIO
import unittest
from git_remote_helpers.util import debug, error, die, sta... | [
[
8,
0,
0.0066,
0.0059,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0118,
0.0015,
0,
0.66,
0.0526,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0133,
0.0015,
0,
0.66... | [
"\"\"\"Functionality for interacting with Git repositories.\n\nThis module provides classes for interfacing with a Git repository.\n\"\"\"",
"import os",
"import re",
"import time",
"from binascii import hexlify",
"from cStringIO import StringIO",
"import unittest",
"from git_remote_helpers.util impor... |
import os
import subprocess
from git_remote_helpers.util import check_call
def sanitize(rev, sep='\t'):
"""Converts a for-each-ref line to a name/value pair.
"""
splitrev = rev.split(sep)
branchval = splitrev[0]
branchname = splitrev[1].strip()
if branchname.startswith("refs/heads/"):
... | [
[
1,
0,
0.0132,
0.0132,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0.2,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0526,
0.0132,
0,
0.6... | [
"import os",
"import subprocess",
"from git_remote_helpers.util import check_call",
"def sanitize(rev, sep='\\t'):\n \"\"\"Converts a for-each-ref line to a name/value pair.\n \"\"\"\n\n splitrev = rev.split(sep)\n branchval = splitrev[0]\n branchname = splitrev[1].strip()\n if branchname.st... |
import os
import subprocess
from git_remote_helpers.util import check_call, check_output
class GitImporter(object):
"""An importer for testgit repositories.
This importer simply delegates to git fast-import.
"""
def __init__(self, repo):
"""Creates a new importer for the specified repo.
... | [
[
1,
0,
0.0152,
0.0152,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0303,
0.0152,
0,
0.66,
0.3333,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0606,
0.0152,
0,
... | [
"import os",
"import subprocess",
"from git_remote_helpers.util import check_call, check_output",
"class GitImporter(object):\n \"\"\"An importer for testgit repositories.\n\n This importer simply delegates to git fast-import.\n \"\"\"\n\n def __init__(self, repo):\n \"\"\"Creates a new imp... |
#!/usr/bin/env python
"""Misc. useful functionality used by the rest of this package.
This module provides common functionality used by the other modules in
this package.
"""
import sys
import os
import subprocess
try:
from subprocess import CalledProcessError
except ImportError:
# from python2.7:subproces... | [
[
8,
0,
0.02,
0.0218,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0364,
0.0036,
0,
0.66,
0.0556,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.04,
0.0036,
0,
0.66,
... | [
"\"\"\"Misc. useful functionality used by the rest of this package.\n\nThis module provides common functionality used by the other modules in\nthis package.\n\n\"\"\"",
"import sys",
"import os",
"import subprocess",
"try:\n from subprocess import CalledProcessError\nexcept ImportError:\n # from pytho... |
#!/usr/bin/env python
"""Support library package for git remote helpers.
Git remote helpers are helper commands that interfaces with a non-git
repository to provide automatic import of non-git history into a Git
repository.
This package provides the support library needed by these helpers..
The following modules are... | [
[
8,
0,
0.5938,
0.875,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\"Support library package for git remote helpers.\n\nGit remote helpers are helper commands that interfaces with a non-git\nrepository to provide automatic import of non-git history into a Git\nrepository.\n\nThis package provides the support library needed by these helpers..\nThe following modules are include... |
#!/usr/bin/python
# MIT 6.035 project 1 grading script
# by Jason Ansel <jansel@csail.mit.edu> on Feb 6, 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public_d... | [
[
1,
0,
0.0263,
0.0053,
0,
0.66,
0,
223,
0,
7,
0,
0,
223,
0,
0
],
[
1,
0,
0.0316,
0.0053,
0,
0.66,
0.1,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0816,
0.0842,
0,
0.66,... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = None\n scanner_skip_tests = ['ws1' # assignment disagreed with t... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0174,
0.0035,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0208,
0.0035,
0,
0.66,
0.0714,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0625,
0.0729,
0,
0.... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project 1 grading script
# by Jason Ansel <jansel@csail.mit.edu> on Feb 6, 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public_d... | [
[
1,
0,
0.0289,
0.0058,
0,
0.66,
0,
223,
0,
7,
0,
0,
223,
0,
0
],
[
1,
0,
0.0347,
0.0058,
0,
0.66,
0.1,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0607,
0.0347,
0,
0.66,... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\")\n ... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0151,
0.003,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0181,
0.003,
0,
0.66,
0.0625,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0695,
0.0937,
0,
0.66... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0174,
0.0035,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0208,
0.0035,
0,
0.66,
0.0714,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0625,
0.0729,
0,
0.... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0174,
0.0035,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0208,
0.0035,
0,
0.66,
0.0714,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0625,
0.0729,
0,
0.... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0151,
0.003,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0181,
0.003,
0,
0.66,
0.0625,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0695,
0.0937,
0,
0.66... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project 1 grading script
# by Jason Ansel <jansel@csail.mit.edu> on Feb 6, 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public_d... | [
[
1,
0,
0.0289,
0.0058,
0,
0.66,
0,
223,
0,
7,
0,
0,
223,
0,
0
],
[
1,
0,
0.0347,
0.0058,
0,
0.66,
0.1,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0607,
0.0347,
0,
0.66,... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\")\n ... |
#!/usr/bin/python
# MIT 6.035 project grading script
# by Jason Ansel <jansel@csail.mit.edu>, Spring 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public... | [
[
1,
0,
0.0174,
0.0035,
0,
0.66,
0,
223,
0,
8,
0,
0,
223,
0,
0
],
[
1,
0,
0.0208,
0.0035,
0,
0.66,
0.0714,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0625,
0.0729,
0,
0.... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil, time",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/hidden\... |
#!/usr/bin/python
# MIT 6.035 project 1 grading script
# by Jason Ansel <jansel@csail.mit.edu> on Feb 6, 2010
# You may redistribute this file under the MIT license
import tarfile, sys, tempfile, subprocess, os, warnings, shutil
from os.path import isfile, isdir, join, dirname, abspath
class config:
scanner_public_d... | [
[
1,
0,
0.0263,
0.0053,
0,
0.66,
0,
223,
0,
7,
0,
0,
223,
0,
0
],
[
1,
0,
0.0316,
0.0053,
0,
0.66,
0.1,
79,
0,
5,
0,
0,
79,
0,
0
],
[
3,
0,
0.0816,
0.0842,
0,
0.66,... | [
"import tarfile, sys, tempfile, subprocess, os, warnings, shutil",
"from os.path import isfile, isdir, join, dirname, abspath",
"class config:\n scanner_public_dir = join(dirname(abspath(sys.argv[0])), \"tests/scanner/\")\n scanner_hidden_dir = None\n scanner_skip_tests = ['ws1' # assignment disagreed with t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-24
@author: shell.xu
'''
import os, sys, time, getopt
import traceback, unicodedata
import chardet, segment
from os import path
segdbname = 'frq.db'
dbname = 'classify.db'
def walkdir(basepath, func, *params):
for base, dirs, files in os.walk(basepath):... | [
[
8,
0,
0.0789,
0.0702,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1228,
0.0175,
0,
0.66,
0.0769,
688,
0,
4,
0,
0,
688,
0,
0
],
[
1,
0,
0.1404,
0.0175,
0,
0.66... | [
"'''\n@date: 2011-11-24\n@author: shell.xu\n'''",
"import os, sys, time, getopt",
"import traceback, unicodedata",
"import chardet, segment",
"from os import path",
"segdbname = 'frq.db'",
"dbname = 'classify.db'",
"def walkdir(basepath, func, *params):\n for base, dirs, files in os.walk(basepath):... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-10-02
@author: shell.xu
'''
from distutils.core import setup
setup(name = 'segment', version = '1.0', url = 'http://shell909090.com/',
author = 'Shell.E.Xu', author_email = 'shell909090@gmail.com',
description = 'segmentation library written by pyth... | [
[
8,
0,
0.375,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5833,
0.0833,
0,
0.66,
0.5,
152,
0,
1,
0,
0,
152,
0,
0
],
[
8,
0,
0.875,
0.3333,
0,
0.66,
... | [
"'''\n@date: 2010-10-02\n@author: shell.xu\n'''",
"from distutils.core import setup",
"setup(name = 'segment', version = '1.0', url = 'http://shell909090.com/',\n author = 'Shell.E.Xu', author_email = 'shell909090@gmail.com',\n description = 'segmentation library written by python',\n packages = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-10-01
@author: shell.xu
'''
import unittest
import segment
db = segment.dictdb('frq.db')
class utCutter(unittest.TestCase):
def setUp(self):
self.c = segment.StringCutter(None)
def test_english_words(self):
self.assertEqual(list(self.... | [
[
8,
0,
0.045,
0.04,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.07,
0.01,
0,
0.66,
0.1667,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.08,
0.01,
0,
0.66,
0.3333,... | [
"'''\n@date: 2010-10-01\n@author: shell.xu\n'''",
"import unittest",
"import segment",
"db = segment.dictdb('frq.db')",
"class utCutter(unittest.TestCase):\n\n def setUp(self):\n self.c = segment.StringCutter(None)\n\n def test_english_words(self):\n self.assertEqual(list(self.c.parse(u\... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-16
@author: shell.xu
'''
import math, marshal
from dbase import dbase
class dictdb(dbase):
def save(self, fo):
marshal.dump((self.db, self.sdb, self.dbs, self.sdbs), fo)
def load(self, fi):
self.db, self.sdb, self.dbs, self.sdbs = ma... | [
[
8,
0,
0.0549,
0.0488,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0854,
0.0122,
0,
0.66,
0.3333,
526,
0,
2,
0,
0,
526,
0,
0
],
[
1,
0,
0.0976,
0.0122,
0,
0.66... | [
"'''\n@date: 2011-11-16\n@author: shell.xu\n'''",
"import math, marshal",
"from dbase import dbase",
"class dictdb(dbase):\n\n def save(self, fo):\n marshal.dump((self.db, self.sdb, self.dbs, self.sdbs), fo)\n def load(self, fi):\n self.db, self.sdb, self.dbs, self.sdbs = marshal.load(fi)\... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-24
@author: shell.xu
'''
import chardet
class dbase(object):
def __init__(self, filepath = None):
self.close()
self.filepath = filepath
if self.filepath: self.loadfile(filepath)
def sync(self):
if self.filepath: self.... | [
[
8,
0,
0.1324,
0.1176,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2059,
0.0294,
0,
0.66,
0.25,
475,
0,
1,
0,
0,
475,
0,
0
],
[
3,
0,
0.4412,
0.3824,
0,
0.66,
... | [
"'''\n@date: 2011-11-24\n@author: shell.xu\n'''",
"import chardet",
"class dbase(object):\n def __init__(self, filepath = None):\n self.close()\n self.filepath = filepath\n if self.filepath: self.loadfile(filepath)\n\n def sync(self):\n if self.filepath: self.savefile(self.file... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-16
@author: shell.xu
'''
from dbase import *
from dictdb import dictdb
class DynamicCutter(CutterBase):
DEBUG = False
def __init__(self, db):
self.db, self.cache = db, {}
@classmethod
def cmp_subtree(cls, r1, r2):
if r1 is N... | [
[
8,
0,
0.0563,
0.05,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0875,
0.0125,
0,
0.66,
0.3333,
48,
0,
1,
0,
0,
48,
0,
0
],
[
1,
0,
0.1,
0.0125,
0,
0.66,
0... | [
"'''\n@date: 2011-11-16\n@author: shell.xu\n'''",
"from dbase import *",
"from dictdb import dictdb",
"class DynamicCutter(CutterBase):\n DEBUG = False\n\n def __init__(self, db):\n self.db, self.cache = db, {}\n\n @classmethod\n def cmp_subtree(cls, r1, r2):",
" DEBUG = False",
" ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-16
@author: shell.xu
'''
from dbase import *
import unicodedata
chrcat = unicodedata.category
punct_set = set(['Ll', 'Lu', 'Lo', 'Nd'])
def split_punct(stc, s):
for e in xrange(s, len(stc)):
if chrcat(stc[e]) in punct_set: return e
return len... | [
[
8,
0,
0.0542,
0.0482,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0843,
0.012,
0,
0.66,
0.1111,
48,
0,
1,
0,
0,
48,
0,
0
],
[
1,
0,
0.0964,
0.012,
0,
0.66,
... | [
"'''\n@date: 2011-11-16\n@author: shell.xu\n'''",
"from dbase import *",
"import unicodedata",
"chrcat = unicodedata.category",
"punct_set = set(['Ll', 'Lu', 'Lo', 'Nd'])",
"def split_punct(stc, s):\n for e in xrange(s, len(stc)):\n if chrcat(stc[e]) in punct_set: return e\n return len(stc)",... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-17
@author: shell.xu
'''
import os, sys
import dyn, dictdb
class StatCutter(dyn.DynamicCutter):
def __init__(self, db):
super(StatCutter, self).__init__(db)
self.wordfrq = {}
def parse(self, sentence):
frq, rslt = self.split... | [
[
8,
0,
0.0776,
0.069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1207,
0.0172,
0,
0.66,
0.25,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1379,
0.0172,
0,
0.66,
... | [
"'''\n@date: 2011-11-17\n@author: shell.xu\n'''",
"import os, sys",
"import dyn, dictdb",
"class StatCutter(dyn.DynamicCutter):\n\n def __init__(self, db):\n super(StatCutter, self).__init__(db)\n self.wordfrq = {}\n\n def parse(self, sentence):\n frq, rslt = self.split(sentence)",
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-15
@author: shell.xu
'''
import os, sys, math, marshal
import unicodedata
from dbase import dbase, readfile_cd
def fixinit(mid):
def getfunc(func):
return lambda *p: (func(*p) + mid) / 2
return getfunc
class Fisher(dbase):
FORBIDDEN = se... | [
[
8,
0,
0.0577,
0.0513,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0897,
0.0128,
0,
0.66,
0.2,
688,
0,
4,
0,
0,
688,
0,
0
],
[
1,
0,
0.1026,
0.0128,
0,
0.66,
... | [
"'''\n@date: 2011-11-15\n@author: shell.xu\n'''",
"import os, sys, math, marshal",
"import unicodedata",
"from dbase import dbase, readfile_cd",
"def fixinit(mid):\n def getfunc(func):\n return lambda *p: (func(*p) + mid) / 2\n return getfunc",
" def getfunc(func):\n return lambda *... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-16
@author: shell.xu
'''
from dbase import readfile_cd
from dictdb import dictdb
from cut import StringCutter
from dyn import DynamicCutter
from train import StatCutter, NewCutter
from fisher import Fisher
def get_cutter(filepath):
return StringCutter(Dy... | [
[
8,
0,
0.3,
0.2667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4667,
0.0667,
0,
0.66,
0.1429,
48,
0,
1,
0,
0,
48,
0,
0
],
[
1,
0,
0.5333,
0.0667,
0,
0.66,
... | [
"'''\n@date: 2011-11-16\n@author: shell.xu\n'''",
"from dbase import readfile_cd",
"from dictdb import dictdb",
"from cut import StringCutter",
"from dyn import DynamicCutter",
"from train import StatCutter, NewCutter",
"from fisher import Fisher",
"def get_cutter(filepath):\n return StringCutter(D... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-22
@author: shell.xu
'''
import segment
cut = segment.get_cutter('frq.db')
def cuttest(word):
print word
print u'|'.join([i for i in cut.parse(word.decode('utf-8'))])
def test_dyn1():
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttes... | [
[
8,
0,
0.0625,
0.0556,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0972,
0.0139,
0,
0.66,
0.2,
100,
0,
1,
0,
0,
100,
0,
0
],
[
14,
0,
0.125,
0.0139,
0,
0.66,
... | [
"'''\n@date: 2011-11-22\n@author: shell.xu\n'''",
"import segment",
"cut = segment.get_cutter('frq.db')",
"def cuttest(word):\n print(word)\n print(u'|'.join([i for i in cut.parse(word.decode('utf-8'))]))",
" print(word)",
" print(u'|'.join([i for i in cut.parse(word.decode('utf-8'))]))",
"d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2011-11-18
@author: shell.xu
'''
import os, sys, urllib
import threading, urlparse, traceback
import html2text, chardet
from StringIO import StringIO
from lxml import etree, html
sys.path.insert(0, '../')
import segment
queue = []
class spider(threading.Thread):
... | [
[
8,
0,
0.0634,
0.0563,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0986,
0.0141,
0,
0.66,
0.0909,
688,
0,
3,
0,
0,
688,
0,
0
],
[
1,
0,
0.1127,
0.0141,
0,
0.66... | [
"'''\n@date: 2011-11-18\n@author: shell.xu\n'''",
"import os, sys, urllib",
"import threading, urlparse, traceback",
"import html2text, chardet",
"from StringIO import StringIO",
"from lxml import etree, html",
"sys.path.insert(0, '../')",
"import segment",
"queue = []",
"class spider(threading.Th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.