text
stringlengths
0
1.05M
meta
dict
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import numpy as nm import os import os.path as op import fnmatch import shutil from base import output, Struct, basestr try: import tables as pt except: pt = None class InDir(Struct): """ Store the directory name a file is i...
{ "repo_name": "vlukes/dicom2fem", "path": "dicom2fem/ioutils.py", "copies": "1", "size": "8061", "license": "bsd-3-clause", "hash": -4072875990405852700, "line_mean": 24.6719745223, "line_max": 76, "alpha_frac": 0.5686639375, "autogenerated": false, "ratio": 3.544854881266491, "config_test": fa...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import sys from copy import copy import os.path as op import numpy as nm from base import (complex_types, dict_from_keys_init, assert_, is_derived_class, insert_static_method, output, get_default, ...
{ "repo_name": "vlukes/dicom2fem", "path": "dicom2fem/meshio.py", "copies": "1", "size": "86894", "license": "bsd-3-clause", "hash": -2948851048050807300, "line_mean": 31.5689655172, "line_max": 88, "alpha_frac": 0.4448063157, "autogenerated": false, "ratio": 3.5685420944558524, "config_test": f...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import sys from copy import copy import os.path as op import numpy as nm from .base import ( complex_types, dict_from_keys_init, assert_, is_derived_class, insert_static_method, output, get_default, get_defau...
{ "repo_name": "mjirik/dicom2fem", "path": "dicom2fem/meshio.py", "copies": "1", "size": "86767", "license": "bsd-3-clause", "hash": -8770243911784632000, "line_mean": 29.5625220148, "line_max": 88, "alpha_frac": 0.4490647366, "autogenerated": false, "ratio": 3.596112400530504, "config_test": fa...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import time import numpy as nm import scipy.sparse as sp from base import Struct, get_default, output, assert_ from meshio import MeshIO ## # 28.05.2007, c def make_point_cells( indx, dim ): conn = nm.zeros( (indx.shape[0], dim + 1), d...
{ "repo_name": "vlukes/dicom2fem", "path": "dicom2fem/mesh.py", "copies": "1", "size": "27478", "license": "bsd-3-clause", "hash": -2501733847062933500, "line_mean": 31.1380116959, "line_max": 80, "alpha_frac": 0.5035300968, "autogenerated": false, "ratio": 3.3591687041564793, "config_test": fal...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import time import numpy as nm import scipy.sparse as sp from .base import Struct, get_default, output, assert_ from .meshio import MeshIO ## # 28.05.2007, c def make_point_cells(indx, dim): conn = nm.zeros((indx.shape[0], dim + 1), dt...
{ "repo_name": "mjirik/dicom2fem", "path": "dicom2fem/mesh.py", "copies": "1", "size": "27575", "license": "bsd-3-clause", "hash": -6933944286560148000, "line_mean": 29.948372615, "line_max": 86, "alpha_frac": 0.5108612874, "autogenerated": false, "ratio": 3.3375695957395304, "config_test": fals...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import time, sys, os from copy import copy, deepcopy from types import UnboundMethodType import numpy as nm import scipy.sparse as sp real_types = [nm.float64] complex_types = [nm.complex128] nm.set_printoptions( threshold = 100 ) def ou...
{ "repo_name": "vlukes/dicom2fem", "path": "dicom2fem/base.py", "copies": "1", "size": "31975", "license": "bsd-3-clause", "hash": -2300470462240647000, "line_mean": 26.0287404903, "line_max": 80, "alpha_frac": 0.5068021892, "autogenerated": false, "ratio": 4.046443938243483, "config_test": fals...
# Adopted form SfePy project, see http://sfepy.org # Thanks to Robert Cimrman import time, sys, os from copy import copy, deepcopy # from types import UnboundMethodType import numpy as nm import scipy.sparse as sp real_types = [nm.float64] complex_types = [nm.complex128] nm.set_printoptions(threshold=100) def ou...
{ "repo_name": "mjirik/dicom2fem", "path": "dicom2fem/base.py", "copies": "1", "size": "32325", "license": "bsd-3-clause", "hash": -527888655861369100, "line_mean": 24.5735759494, "line_max": 87, "alpha_frac": 0.5128847641, "autogenerated": false, "ratio": 4.0080595164290145, "config_test": fals...
# adopted from http://gremu.net/blog/2010/django-admin-read-only-permission/ from django.contrib.gis import admin from django.core.exceptions import PermissionDenied from ajax_select.fields import autoselect_fields_check_can_add class ReadOnlyAdmin(admin.OSMGeoAdmin): """ in order to get + popup functions subcla...
{ "repo_name": "ocefpaf/ODM2-Admin", "path": "odm2admin/readonlyadmin.py", "copies": "2", "size": "3019", "license": "mit", "hash": -8767030944464297000, "line_mean": 34.5176470588, "line_max": 93, "alpha_frac": 0.606492216, "autogenerated": false, "ratio": 4.246132208157524, "config_test": fals...
# Adopted from https://github.com/airaria/TextBrewer # Apache License Version 2.0 from abc import ABC, abstractmethod import torch # x is between 0 and 1 from hanlp_common.configurable import AutoConfigurable def linear_growth_weight_scheduler(x): return x def linear_decay_weight_scheduler(x): return 1 - ...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/distillation/schedulers.py", "copies": "1", "size": "3585", "license": "apache-2.0", "hash": 3873581398111176700, "line_mean": 27.9112903226, "line_max": 116, "alpha_frac": 0.6292887029, "autogenerated": false, "ratio": 3.635902636916836, ...
# Adopted from https://github.com/airaria/TextBrewer # Apache License Version 2.0 import torch import torch.nn.functional as F from hanlp_common.configurable import AutoConfigurable def kd_mse_loss(logits_S, logits_T, temperature=1): ''' Calculate the mse loss between logits_S and logits_T :param logit...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/distillation/losses.py", "copies": "1", "size": "15061", "license": "apache-2.0", "hash": 8504197230807629000, "line_mean": 51.8456140351, "line_max": 510, "alpha_frac": 0.6354823717, "autogenerated": false, "ratio": 3.1370547802541138, "c...
# Adopted from https://github.com/allenai/allennlp under Apache Licence 2.0. # Changed the packaging and created a subclass CharCNNEmbedding from typing import Union, Tuple, Optional, Callable import torch from torch import nn from alnlp.modules.cnn_encoder import CnnEncoder from alnlp.modules.time_distributed import ...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/layers/embeddings/char_cnn.py", "copies": "1", "size": "7436", "license": "apache-2.0", "hash": -3051699420792094700, "line_mean": 49.5714285714, "line_max": 123, "alpha_frac": 0.6280602637, "autogenerated": false, "ratio": 4.2, "config_test": false,...
# Adopted from https://github.com/allenai/allennlp under Apache Licence 2.0. # Changed the packaging. from typing import List, Set, Tuple, Dict import numpy def decode_mst( energy: numpy.ndarray, length: int, has_labels: bool = True ) -> Tuple[numpy.ndarray, numpy.ndarray]: """Note: Counter to typical in...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/parsers/chu_liu_edmonds.py", "copies": "1", "size": "10923", "license": "apache-2.0", "hash": 7361882799741844000, "line_mean": 33.7866242038, "line_max": 96, "alpha_frac": 0.6064268058, "autogenerated": false, "ratio": 3.9864963503649635, ...
# adopted from https://github.com/danvk/RangeHTTPServer to allow CORS import os import re try: from http.server import SimpleHTTPRequestHandler except ImportError: from SimpleHTTPServer import SimpleHTTPRequestHandler def copy_byte_range(infile, outfile, start=None, stop=None, bufsize=16*1024): '''Like s...
{ "repo_name": "NabaviLab/CNV-Visualizer", "path": "scripts/cors_server.py", "copies": "1", "size": "5850", "license": "mit", "hash": -809937830573544100, "line_mean": 33.8214285714, "line_max": 79, "alpha_frac": 0.5994871795, "autogenerated": false, "ratio": 3.931451612903226, "config_test": fa...
# Adopted from https://github.com/KiroSummer/A_Syntax-aware_MTL_Framework_for_Chinese_SRL import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from torch.autograd import Variable from .layer import DropoutLayer, HighwayLSTMCell, VariationalLSTMCell def initializer_1d(input_...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/srl/span_rank/highway_variational_lstm.py", "copies": "1", "size": "12805", "license": "apache-2.0", "hash": 3651464124923053600, "line_mean": 50.22, "line_max": 117, "alpha_frac": 0.5814135103, "autogenerated": false, "ratio": 3.66275743707...
# Adopted from https://github.com/KiroSummer/A_Syntax-aware_MTL_Framework_for_Chinese_SRL import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import torch.nn.functional as F from hanlp.components.srl.span_rank.util import block_orth_normal_initializer def get_tensor_np(t): ...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/srl/span_rank/layer.py", "copies": "1", "size": "16572", "license": "apache-2.0", "hash": 5060657347899016000, "line_mean": 41.7113402062, "line_max": 118, "alpha_frac": 0.5599203476, "autogenerated": false, "ratio": 3.4705759162303664, "c...
# Adopted from https://github.com/KiroSummer/A_Syntax-aware_MTL_Framework_for_Chinese_SRL # Inference functions for the SRL model. import numpy as np def decode_spans(span_starts, span_ends, span_scores, labels_inv): """ Args: span_starts: [num_candidates,] span_scores: [num_candidates, num_labe...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/srl/span_rank/inference_utils.py", "copies": "1", "size": "10363", "license": "apache-2.0", "hash": 5019844949522396000, "line_mean": 41.646090535, "line_max": 119, "alpha_frac": 0.585255235, "autogenerated": false, "ratio": 3.38107667210440...
# Adopted from https://github.com/lazyprogrammer/machine_learning_examples/blob/master/nlp_class2/tfidf_tsne.py import json import numpy as np import matplotlib.pyplot as plt from sklearn.utils import shuffle from sklearn.manifold import TSNE from datetime import datetime # import os # import sys # sys.path.append(os...
{ "repo_name": "WayneDW/Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction", "path": "archived/tfidf_tsne.py", "copies": "1", "size": "1827", "license": "mit", "hash": 7551169774974377000, "line_mean": 27.1230769231, "line_max": 111, "alpha_frac": 0.6338259442, "autogenerated": false...
# Adopted from https://github.com/lazyprogrammer/machine_learning_examples/blob/master/rnn_class/util.py # Adopted form https://github.com/lazyprogrammer/machine_learning_examples/blob/master/nlp_class2/util.py import numpy as np import pandas as pd import string import os import operator from nltk import pos_tag, word...
{ "repo_name": "WayneDW/Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction", "path": "archived/utils.py", "copies": "1", "size": "4611", "license": "mit", "hash": 1564728552200417300, "line_mean": 31.7021276596, "line_max": 108, "alpha_frac": 0.5755801345, "autogenerated": false, "...
# Adopted from InspIRCd # https://github.com/inspircd/inspircd/blob/master/include/numerics.h RPL_WELCOME = "001" # 2812, not 1459 RPL_YOURHOSTIS = "002" # 2812, not 1459 RPL_SERVERCREATED = "003" # 2812, not 1459 RPL_SERVERVERSION = "004" # 2812, no...
{ "repo_name": "minus7/asif", "path": "asif/command_codes.py", "copies": "1", "size": "6430", "license": "mit", "hash": 834228490929906400, "line_mean": 39.9554140127, "line_max": 160, "alpha_frac": 0.4622083981, "autogenerated": false, "ratio": 3.3178534571723426, "config_test": false, "has_n...
# Adopted from python-twitter's get_access_key.py # http://code.google.com/p/python-twitter/ import urllib, urllib2 import oauth2 as oauth import twitter try: import json except: import simplejson as json try: from urlparse import parse_qsl except: from cgi import parse_qsl from django.conf import s...
{ "repo_name": "jaysoo/django-twitter", "path": "django_twitter/utils.py", "copies": "1", "size": "2218", "license": "mit", "hash": -6911303535511000000, "line_mean": 34.7741935484, "line_max": 116, "alpha_frac": 0.7339945897, "autogenerated": false, "ratio": 3.360606060606061, "config_test": fa...
"""adopteitor URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
{ "repo_name": "smarbos/adopteitor-server", "path": "urls.py", "copies": "1", "size": "1845", "license": "mit", "hash": 3384562134153681000, "line_mean": 40.9318181818, "line_max": 82, "alpha_frac": 0.745799458, "autogenerated": false, "ratio": 3.372943327239488, "config_test": false, "has_no_...
"""A double-ended queue with an optional maximum size.""" import time from collections import deque from greennet import greenlet from greennet import get_hub from greennet.hub import Wait class QueueWait(Wait): """Abstract class to wait for a Queue event.""" __slots__ = ('queue',) def _...
{ "repo_name": "dhain/greennet", "path": "greennet/queue.py", "copies": "1", "size": "6766", "license": "mit", "hash": 5157170247582765000, "line_mean": 25.5333333333, "line_max": 71, "alpha_frac": 0.49527047, "autogenerated": false, "ratio": 4.095641646489105, "config_test": false, "has_no_ke...
"""A doubly-linked list""" class LLNode(object): """A single node in the list. The pointers to the next and previous nodes should not be manipulated directly, but only through the LList class. Directly setting the pointers can create an inconsistent LList object. Attributes: value: the va...
{ "repo_name": "johnwilmes/py-data-structures", "path": "py_data_structures/llist.py", "copies": "1", "size": "4127", "license": "mit", "hash": 3317669000760705000, "line_mean": 29.5703703704, "line_max": 80, "alpha_frac": 0.5825054519, "autogenerated": false, "ratio": 4.185598377281948, "config...
# adpated from http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.signal.correlate2d.html import matplotlib.pyplot as plt import numpy as np from scipy import signal from scipy import misc print("cross correlation demo") face = misc.face() - misc.face().mean() face = face.sum(-1) template = np.copy(face...
{ "repo_name": "probml/pyprobml", "path": "scripts/xcorr_demo.py", "copies": "1", "size": "1116", "license": "mit", "hash": -2837330267262520300, "line_mean": 26.9, "line_max": 103, "alpha_frac": 0.7123655914, "autogenerated": false, "ratio": 2.70873786407767, "config_test": false, "has_no_key...
""" A drag drawn line. """ from __future__ import with_statement from enable.api import Line from traits.api import Instance from drawing_tool import DrawingTool class DragLine(DrawingTool): """ A drag drawn line. This is not a straight line, but can be a free-form, curved path. """ # Overrid...
{ "repo_name": "tommy-u/enable", "path": "enable/drawing/drag_line.py", "copies": "1", "size": "2630", "license": "bsd-3-clause", "hash": -7839375331935217000, "line_mean": 31.0731707317, "line_max": 78, "alpha_frac": 0.4931558935, "autogenerated": false, "ratio": 4.361525704809287, "config_test...
""" A drag drawn polygon. """ from __future__ import with_statement from enable.primitives.api import Polygon from enable.api import Pointer from pyface.action.api import MenuManager from traits.api import Delegate, Instance from drawing_tool import DrawingTool class DragPolygon(DrawingTool): """ A drag drawn p...
{ "repo_name": "tommy-u/enable", "path": "enable/drawing/drag_polygon.py", "copies": "1", "size": "3886", "license": "bsd-3-clause", "hash": 8425185192589923000, "line_mean": 27.3649635036, "line_max": 79, "alpha_frac": 0.5247040659, "autogenerated": false, "ratio": 4.284454244762955, "config_te...
"""Adres API tests.""" import unittest import postcodepy from postcodepy import typedefs from postcodepy import PostcodeError from . import unittestsetup try: from nose_parameterized import parameterized, param except: print("*** Please install 'nose_parameterized' to run these tests ***") exit(1) import ...
{ "repo_name": "hootnot/postcode-api-wrapper", "path": "tests/test_adres_api.py", "copies": "1", "size": "10115", "license": "mit", "hash": 5456670431273982000, "line_mean": 32.7166666667, "line_max": 88, "alpha_frac": 0.5672763223, "autogenerated": false, "ratio": 4.233989116785266, "config_tes...
# Adrian deWynter, 2016 # Check that Spark is working from pyspark.sql import Row data = [('Alice', 1), ('Bob', 2), ('Bill', 4)] df = sqlContext.createDataFrame(data, ['name', 'age']) fil = df.filter(df.age > 3).collect() print fil # If the Spark job doesn't work properly this will raise an AssertionError assert fil =...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark/Before starting.py", "copies": "1", "size": "1903", "license": "mit", "hash": -7091245741693466000, "line_mean": 35.6153846154, "line_max": 105, "alpha_frac": 0.6931161324, "autogenerated": false, "ratio": 3.059485530546624, "config_test...
# Adrian deWynter, 2016 # Implementation of Adam, as per the original paper available at https://arxiv.org/pdf/1412.6980.pdf # I tried to make it as versatile as possible, but there are caveats: # Most operations are element-wise, and it's written with NN use in mind. # TODO: Adam's update rule is unimplemented. # TOD...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/MachineLearning/Adam.py", "copies": "1", "size": "2599", "license": "mit", "hash": -5465066992736361000, "line_mean": 39.625, "line_max": 114, "alpha_frac": 0.6217776068, "autogenerated": false, "ratio": 3.208641975308642, "config_test": false, ...
# Adrian deWynter, 2016 # Implementation of: # - GCD # - LCM # - LCMM # - LCM (sequence) # - XOR-based swap # - power set generator def gcd(a, b): """Return greatest common divisor using Euclid's Algorithm.""" while b: a, b = b, a % b return a def lcm(a, b): """Return lowest common...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/numberTheory/util.py", "copies": "1", "size": "3478", "license": "mit", "hash": -6212684117061600000, "line_mean": 22.0397350993, "line_max": 89, "alpha_frac": 0.459746981, "autogenerated": false, "ratio": 3.217391304347826, "config_test": fa...
# Adrian deWynter, 2016 import heapq import math def dijkstra(adj, cost, N, s): visited = {} ans = {} Q = [] for k,v in adj.iteritems(): if k != s: heapq.heappush(Q, [float('inf'), k, float('inf')]) visited[k] = 0 ans[k] = -1 heapq...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/graphAlgorithms/dijkstra.py", "copies": "1", "size": "2037", "license": "mit", "hash": -1901752516514913500, "line_mean": 22.6860465116, "line_max": 62, "alpha_frac": 0.3190967108, "autogenerated": false, "ratio": 3.67027027027027, "config_te...
# Adrian deWynter, 2016 import heapq def dijkstra(adj, cost, N, s): visited = {} ans = {} Q = [] for k in range(1, N+1): if k != s: heapq.heappush(Q, [99999, k, 99999]) visited[k] = 0 ans[k] = 99999 heapq.heappush(Q, [0, s, 0]) ...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/graphAlgorithms/prim.py", "copies": "1", "size": "1512", "license": "mit", "hash": 148112077675762530, "line_mean": 20.6, "line_max": 57, "alpha_frac": 0.3670634921, "autogenerated": false, "ratio": 3.210191082802548, "config_test": false, ...
# Adrian deWynter, 2016 import nltk nltk.download() ## Working with custom files file = open('PATH') temp = file.read() tokens = nltk.word_tokenize(temp) text = nltk.Text(tokens) # can also be an URL from urllib import request url = "" response = request.urlopen(url) raw = response.read().decode('encoding') # then jus...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/NLTK.py", "copies": "1", "size": "1762", "license": "mit", "hash": 5558307196375385000, "line_mean": 28.3833333333, "line_max": 134, "alpha_frac": 0.7412031782, "autogenerated": false, "ratio": 3.23302752293578, "config_test": false, "has_no_k...
# Adrian deWynter, 2016 import pandas as pd import numpy as np import scipy.io from sklearn.decomposition import PCA, RandomizedPCA from plyfile import PlyData, PlyElement from sklearn import manifold from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib import random, math, datet...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/DataScience/appliedExamples.py", "copies": "1", "size": "2419", "license": "mit", "hash": 10942366052931042, "line_mean": 27.1395348837, "line_max": 100, "alpha_frac": 0.7007027697, "autogenerated": false, "ratio": 2.7027932960893857, "config_te...
# Adrian deWynter, 2016 import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import linear_model matplotlib.style.use('ggplot') def drawLine(model, X_test, y_test, title): fig = plt.figure() ax = fig.add_subplot(111) ax.scatter(X_test, y_test, c='g', mark...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/MachineLearning/LinearRegression.py", "copies": "1", "size": "1362", "license": "mit", "hash": 4197394115512178700, "line_mean": 24.7647058824, "line_max": 79, "alpha_frac": 0.6534508076, "autogenerated": false, "ratio": 2.6811023622047245, "con...
# Adrian deWynter, 2016 import sys import queue class Vertex: def __init__(self): self.edges = {} def getEdges(self): return self.edges def addEdge(self, value, distance): if value not in self.edges or distance < self.edges[value]: self.edges[value] = distance class...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/graphAlgorithms/Dijkstra_forreal.py", "copies": "1", "size": "1930", "license": "mit", "hash": 99598304461555870, "line_mean": 21.7176470588, "line_max": 67, "alpha_frac": 0.4968911917, "autogenerated": false, "ratio": 3.634651600753296, "con...
# Adrian deWynter, 2016 # Insertion sort and bubble sort are just the same thing # only that insertion sort will generate a new array every time... def insertionSort(ar): swaps = 0 index = 1 while index < len(ar) - 1: for i in xrange(index, -1, -1): temp = ar[i] if ar[i...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/sortingAndSearch/sorting.py", "copies": "1", "size": "1374", "license": "mit", "hash": 338078053452162300, "line_mean": 21.9166666667, "line_max": 66, "alpha_frac": 0.5087336245, "autogenerated": false, "ratio": 3.3925925925925924, "config_te...
# Adrian deWynter, 2016 # I wrote this application because I needed to calculate # how much paid time out (PTO) I could take given a certain # day. Lel. # Only works in 'Murica because we have different holidays :) # I think I omitted static holidays (Thanksgiving, for example) import matplotlib.pyplot as plt import...
{ "repo_name": "adewynter/Tools", "path": "Scripts/ptoCalculator.py", "copies": "1", "size": "4876", "license": "mit", "hash": -3569800904870501000, "line_mean": 27.3546511628, "line_max": 95, "alpha_frac": 0.661197703, "autogenerated": false, "ratio": 2.6835443037974684, "config_test": false, ...
# Adrian deWynter, 2016 #Longest common subsequence def LCS(A, B): M = [[None]*(len(B) + 1) for _ in xrange(len(A) + 1)] for i in range(len(A) + 1): for j in range(len(B) + 1): if i == 0 or j == 0: M[i][j] = 0 elif A[i - 1] == B[j - 1]: ...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/dynamicProgramming/LCS.py", "copies": "1", "size": "1050", "license": "mit", "hash": -8236671503420694000, "line_mean": 22.8636363636, "line_max": 57, "alpha_frac": 0.3476190476, "autogenerated": false, "ratio": 2.7777777777777777, "config_te...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one implements a math review. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to run anywhere that isn't Spark -- and some data...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark-ML/Math review.py", "copies": "1", "size": "6663", "license": "mit", "hash": 2638941619262329300, "line_mean": 30.1401869159, "line_max": 98, "alpha_frac": 0.6644154285, "autogenerated": false, "ratio": 2.9262187088274043, "config_test":...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one implements (another) a word count application. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to run anywhere that isn't S...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark-ML/Word count.py", "copies": "1", "size": "4165", "license": "mit", "hash": -2722293236089868000, "line_mean": 29.8592592593, "line_max": 126, "alpha_frac": 0.6931572629, "autogenerated": false, "ratio": 3.342696629213483, "config_test":...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one implements a supervised learning pipeline with the Million Song Dataset. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark-ML/Linear Regression.py", "copies": "1", "size": "22285", "license": "mit", "hash": 7212473767967123000, "line_mean": 41.2884250474, "line_max": 122, "alpha_frac": 0.675072919, "autogenerated": false, "ratio": 3.12333566923616, "config_t...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one is a (very) basic intro to Spark. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to run anywhere that isn't Spark -- and s...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark/Intro to Spark.py", "copies": "1", "size": "4665", "license": "mit", "hash": 4513615648289129500, "line_mean": 29.1032258065, "line_max": 114, "alpha_frac": 0.7026795284, "autogenerated": false, "ratio": 3.221685082872928, "config_test":...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one pertains to analysis of logs and traffic to a website. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to run anywhere that...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark/Traffic analysis.py", "copies": "1", "size": "16244", "license": "mit", "hash": -6202390171504634000, "line_mean": 35.9204545455, "line_max": 160, "alpha_frac": 0.6546417139, "autogenerated": false, "ratio": 3.125048095421316, "config_te...
# Adrian deWynter, 2016 ''' Adrian deWynter (2016) Notebook corresponding to an Apache Spark class I once took. This one pertains to analysis of texts, more specifically word count. ''' ##### # Remember, databricks has a built-in function (display) that isn't available elsewhere. # This code isn't meant to run anywher...
{ "repo_name": "adewynter/Tools", "path": "Notebooks/Spark/Text analysis.py", "copies": "1", "size": "4091", "license": "mit", "hash": 3825622731199805000, "line_mean": 33.9743589744, "line_max": 104, "alpha_frac": 0.6968956245, "autogenerated": false, "ratio": 3.715712988192552, "config_test": ...
# Adrian deWynter, 2016 def BFS(adj, cost, s, V): Q = [] Q.append((0, s, 0)) while Q: d, u, p = Q.pop(0) if u in adj: for n in adj[u]: if cost[n] == 0: d = cost[u] + 6 cost[n] = d ...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/graphAlgorithms/BFSshortestreach.py", "copies": "1", "size": "1352", "license": "mit", "hash": -4483557394305601000, "line_mean": 20.140625, "line_max": 62, "alpha_frac": 0.3150887574, "autogenerated": false, "ratio": 3.5116883116883115, "con...
# Adrian deWynter, 2016 '''Python definitions of factoring algorithms, and prime list generation.''' def factor1(n): """returns a list of prime factors of n""" d = 2 factors = [ ] #empty list while n > 1: if n % d == 0: factors.append(d) n = n/d else: d = d + 1 ...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/numberTheory/factoring.py", "copies": "1", "size": "3409", "license": "mit", "hash": -5712238215096947000, "line_mean": 29.7207207207, "line_max": 80, "alpha_frac": 0.5734819595, "autogenerated": false, "ratio": 3.6035940803382664, "config_te...
# Adrian deWynter, 2016 # This dataset has call records for 10 users tracked over the course of 3 years. # Use K Means to find out where the users live, work, and commute. import pandas as pd from datetime import timedelta from sklearn.cluster import KMeans import matplotlib.pyplot as plt import matplotlib # People a...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/MachineLearning/Kmeans-CellTowers.py", "copies": "1", "size": "3733", "license": "mit", "hash": -5375882972834845000, "line_mean": 34.5619047619, "line_max": 119, "alpha_frac": 0.7173854808, "autogenerated": false, "ratio": 3.0648604269293926, "...
# Adrian deWynter, 2016 # This dataset is nasty, so we are also going to use some PCA. import numpy as np import pandas as pd from sklearn import preprocessing from sklearn.cluster import KMeans import matplotlib.pyplot as plt import matplotlib import math PLOT_TYPE_TEXT = False PLOT_VECTORS = True matplotlib.style.u...
{ "repo_name": "adewynter/Tools", "path": "MLandDS/MachineLearning/Kmeans-CustomerAnalysis.py", "copies": "1", "size": "3531", "license": "mit", "hash": 3102393988818930000, "line_mean": 31.7037037037, "line_max": 110, "alpha_frac": 0.7063154914, "autogenerated": false, "ratio": 2.7979397781299524...
# Adrian deWynter, 2017 # Implementation of: # - Factorial function # - Number of zeros in factorial # - Big number mod M # - Equilateral Pascal's Triangle # A recursive implementation of factorial. def factorial(N): if N == 0 or N == 1: return 1 if N == 2: return 2 else: return N*factorial(N-1) # Calculat...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/numberTheory/util2.py", "copies": "1", "size": "1680", "license": "mit", "hash": 1398668973971843600, "line_mean": 19.0119047619, "line_max": 69, "alpha_frac": 0.6113095238, "autogenerated": false, "ratio": 2.393162393162393, "config_test": f...
# Adrian deWynter, 2017 # Implementation of various algorithms # applied to strings # Given a long string find the greater # number that is also a palindrome. def nextPalindrome(S): def isPalindrome(x): return x == x[::-1] while True: S = S + 1 if isPalindrome(S): return S # Given two words A,B find if A = r...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/stringOps.py", "copies": "1", "size": "4317", "license": "mit", "hash": -1284095204729518800, "line_mean": 17.7695652174, "line_max": 60, "alpha_frac": 0.5788742182, "autogenerated": false, "ratio": 2.3060897435897436, "config_test": false, ...
# Adrian deWynter, 2017 # Random exercises for linked lists # and stuff I couldn't fit in the # other categories. # Sum of two linked lists -- pick the smallest # and padd with zeros def twoNums(L1,L2): # Assume this is a linked list ans = [[0,i] for i in range(max(len(L2),len(L1)))] carry = 0 # Something like ...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/exercises.py", "copies": "1", "size": "4427", "license": "mit", "hash": 8002738199428586000, "line_mean": 18.1688311688, "line_max": 64, "alpha_frac": 0.6428732776, "autogenerated": false, "ratio": 2.5648899188876015, "config_test": false, ...
# Adrian deWynter import bisect import random # Predefined classes # Non deterministic finite automaton class NFA(object): EPSILON,ANY = object(),object() def __init__(self, start_state): self.transitions = {} self.final_states = set() self._start_state = start_state @property def start_state(self): re...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/dataStructures/levensheinAutomata.py", "copies": "1", "size": "5905", "license": "mit", "hash": 8737966731999849000, "line_mean": 25.4843049327, "line_max": 118, "alpha_frac": 0.666553768, "autogenerated": false, "ratio": 2.8132444020962364, ...
# Adrian deWynter ###################################################### # General info ##################################################### # Takes in a document and turns it into a k-ary tree. # We need to modify the binary tree structure to support # siblings. I.e., for the sample provided in the .pdf, the # output...
{ "repo_name": "adewynter/Tools", "path": "Algorithms/Exercises/Python/parser.py", "copies": "1", "size": "5954", "license": "mit", "hash": -5297029871998038000, "line_mean": 28.6268656716, "line_max": 90, "alpha_frac": 0.6451125294, "autogenerated": false, "ratio": 3.512684365781711, "config_te...
"""Adrian language AST nodes.""" from dataclasses import dataclass, field from typing import Optional, Tuple, List # Types and expressions class Type: pass class Expression: pass # @Cleanup: rearrange fields; do we need is_only_named field? # @Cleanup: move to ArgumentDeclaration @dataclass class Argumen...
{ "repo_name": "adrian-lang/adrian", "path": "adrian-cpp-compiler-in-py/adrian_cpp_py/adrian_ast.py", "copies": "1", "size": "7494", "license": "bsd-3-clause", "hash": 8281820577030127000, "line_mean": 22.6403785489, "line_max": 84, "alpha_frac": 0.6817453963, "autogenerated": false, "ratio": 3.67...
# Adrian Rosebrock CV boilerplate # import the necessary packages from django.views.decorators.csrf import csrf_exempt from django.http import JsonResponse import numpy as np import urllib import cv2 import base64 @csrf_exempt def detection(request): # initialize the data dictionary to be returned by the request ...
{ "repo_name": "RoasteryHub/lavie-selekopi", "path": "KopiSelection/views.py", "copies": "1", "size": "4572", "license": "mit", "hash": -7081262267436723000, "line_mean": 35.2857142857, "line_max": 115, "alpha_frac": 0.5962379703, "autogenerated": false, "ratio": 3.450566037735849, "config_test"...
# Adrian Rosebrock Gradient descent with Python # http://www.pyimagesearch.com/2016/10/10/gradient-descent-with-python/ # import the necessary packages import matplotlib.pyplot as plt from sklearn.datasets.samples_generator import make_blobs import numpy as np import argparse def sigmoid_activation(x): # compute and...
{ "repo_name": "mbayon/TFG-MachineLearning", "path": "Gradient-Descent-Roosebrock/gradient-descent-rosebrock.py", "copies": "1", "size": "3811", "license": "mit", "hash": -6732967676216497000, "line_mean": 35.3047619048, "line_max": 71, "alpha_frac": 0.7173970087, "autogenerated": false, "ratio": ...
# A driver for rendering 2D images using the FijiBento alignment project # The input is a directory that contains image files (tilespecs) where each file is of a single section, # and the output is a 2D montage of these sections # # requires: # - java (executed from the command line) # - import sys import os import a...
{ "repo_name": "Rhoana/rh_aligner", "path": "old/2d_render_driver.py", "copies": "1", "size": "2202", "license": "mit", "hash": -2138760151976209700, "line_mean": 36.3220338983, "line_max": 130, "alpha_frac": 0.6825613079, "autogenerated": false, "ratio": 3.627677100494234, "config_test": false,...
# A driver for rendering 2D images using the FijiBento alignment project # The input is a tilespec (json) file of a single section, # and the output is a directory with squared tiles of the 2D montage of the sections # # requires: # - java (executed from the command line) # - import sys import os import argparse impo...
{ "repo_name": "Rhoana/rh_aligner", "path": "old/2d_render_tiles_driver.py", "copies": "1", "size": "3533", "license": "mit", "hash": -124119443825206060, "line_mean": 40.5647058824, "line_max": 145, "alpha_frac": 0.658080951, "autogenerated": false, "ratio": 3.561491935483871, "config_test": fa...
# A driver for running 2D alignment using the FijiBento alignment project # The input is a directory that contains image files (tiles), and the output is a 2D montage of these files # Activates ComputeSIFTFeaturs -> MatchSIFTFeatures -> OptimizeMontageTransfrom # and the result can then be rendered if needed # # requir...
{ "repo_name": "Rhoana/rh_aligner", "path": "old/2d_align_affine_driver.py", "copies": "1", "size": "5463", "license": "mit", "hash": 7823267391598086000, "line_mean": 40.3863636364, "line_max": 173, "alpha_frac": 0.6979681494, "autogenerated": false, "ratio": 3.4597846738442053, "config_test": ...
# A driver for running 3D alignment using the FijiBento alignment project # The input is two tile spec files with their 2d alignment # and each file has also a z axis (layer) index, and the output is a tile spec after 3D alignment # Activates ComputeLayerSIFTFeaturs -> MatchLayersSIFTFeatures -> FilterRansac -> Optimiz...
{ "repo_name": "Rhoana/rh_aligner", "path": "old/3d_align_affine_driver.py", "copies": "1", "size": "10045", "license": "mit", "hash": 1061204726325815600, "line_mean": 42.864628821, "line_max": 167, "alpha_frac": 0.6549527128, "autogenerated": false, "ratio": 3.3394281914893615, "config_test": ...
"""A dropdown completer widget for the qtconsole.""" from qtconsole.qt import QtCore, QtGui class CompletionWidget(QtGui.QListWidget): """ A widget for GUI tab completion. """ #-------------------------------------------------------------------------- # 'QObject' interface #---------------------...
{ "repo_name": "nitin-cherian/LifeLongLearning", "path": "Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/qtconsole/completion_widget.py", "copies": "10", "size": "6165", "license": "mit", "hash": 2845136489873942500, "line_mean": 38.7741935484, "line_max": 79, "al...
"""A dropdown completer widget for the qtconsole.""" import os import sys from qtpy import QtCore, QtGui, QtWidgets class CompletionWidget(QtWidgets.QListWidget): """ A widget for GUI tab completion. """ #-------------------------------------------------------------------------- # 'QObject' interfa...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/qtconsole/completion_widget.py", "copies": "1", "size": "8391", "license": "mit", "hash": 1386138399002421500, "line_mean": 38.2102803738, "line_max": 85, "alpha_frac": 0.5477297104, "autogenerated": false, "ratio": 4...
"""A dropdown completer widget for the qtconsole.""" # System library imports from IPython.external.qt import QtCore, QtGui class CompletionWidget(QtGui.QListWidget): """ A widget for GUI tab completion. """ #-------------------------------------------------------------------------- # 'QObject' inte...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/qt/console/completion_widget.py", "copies": "1", "size": "5371", "license": "mit", "hash": 3849019426117285000, "line_mean": 37.3642857143, "line_max": 79, "alpha_frac": 0.5187115993, "autogenerated": false, "ratio": 4.851851851851...
"""A drop-in replacement for tempfile that adds the errors argument to NamedTemporary and TemporaryFile. """ import os import io import tempfile from tempfile import * # pylint: disable=wildcard-import, ungrouped-imports __all__ = tempfile.__all__ def _patch_encoding(ctor, mode, **kwargs): "Wrap the resulting i...
{ "repo_name": "nxdevel/nx_tempfile", "path": "nx_tempfile/__init__.py", "copies": "1", "size": "2737", "license": "mit", "hash": 605129901143096200, "line_mean": 35.9864864865, "line_max": 96, "alpha_frac": 0.6737303617, "autogenerated": false, "ratio": 4.330696202531645, "config_test": false, ...
ADS_ATTR_CLEAR = ( 1 ) ADS_ATTR_UPDATE = ( 2 ) ADS_ATTR_APPEND = ( 3 ) ADS_ATTR_DELETE = ( 4 ) ADS_EXT_MINEXTDISPID = ( 1 ) ADS_EXT_MAXEXTDISPID = ( 16777215 ) ADS_EXT_INITCREDENTIALS = ( 1 ) ADS_EXT_INITIALIZE_COMPLETE = ( 2 ) ADS_SEARCHPREF_ASYNCHRONOUS = 0 ADS_SEARCHPREF_DEREF_ALIASES = 1 ADS_SEARCHPREF_SIZE...
{ "repo_name": "kkdd/arangodb", "path": "3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/adsi/adsicon.py", "copies": "17", "size": "12544", "license": "apache-2.0", "hash": -3502810082107859000, "line_mean": 36.3333333333, "line_max": 91, "alpha_frac": 0.7641103316, "autogener...
ADS_ATTR_CLEAR = ( 1 ) ADS_ATTR_UPDATE = ( 2 ) ADS_ATTR_APPEND = ( 3 ) ADS_ATTR_DELETE = ( 4 ) ADS_EXT_MINEXTDISPID = ( 1 ) ADS_EXT_MAXEXTDISPID = ( 16777215 ) ADS_EXT_INITCREDENTIALS = ( 1 ) ADS_EXT_INITIALIZE_COMPLETE = ( 2 ) ADS_SEARCHPREF_ASYNCHRONOUS = 0 ADS_SEARCHPREF_DEREF_ALIASES = 1 ADS_SEAR...
{ "repo_name": "Southpaw-TACTIC/Team", "path": "src/python/Lib/site-packages/win32comext/adsi/adsicon.py", "copies": "1", "size": "12880", "license": "epl-1.0", "hash": 6591334290745903000, "line_mean": 36.3333333333, "line_max": 91, "alpha_frac": 0.7441770186, "autogenerated": false, "ratio": 2.2...
""" ADT stands for Algebraic data type """ from rhetoric.exceptions import ConfigurationError class ADTConfiguratorMixin(object): def update_adt_registry(self, adt_meta): """ :type adt_meta: dict """ adt_type = adt_meta['type'] self.adt[adt_type] = adt_meta def check...
{ "repo_name": "avanov/Rhetoric", "path": "rhetoric/config/adt.py", "copies": "1", "size": "1118", "license": "mit", "hash": 8713968545831401000, "line_mean": 35.064516129, "line_max": 81, "alpha_frac": 0.4821109123, "autogenerated": false, "ratio": 4.4189723320158105, "config_test": false, "h...
""" A dual network policy gradient RL architecture: Model network learns a representation of the environment on the basis of observations it receives from the interactions between the PolicyNet - encoding the agent - and the true environment. PolicyNet learns its optimal policy by learning from the simulated data provi...
{ "repo_name": "demelin/learning_reinforcement_learning", "path": "model_based_rl.py", "copies": "1", "size": "17484", "license": "mit", "hash": 1691261135482080800, "line_mean": 49.386167147, "line_max": 120, "alpha_frac": 0.5899107756, "autogenerated": false, "ratio": 3.7803243243243245, "conf...
#adults dataset def load_adult(): """loads adult dataset""" remove_sp = lambda n: n.replace(' ', '') last_column = lambda i: i.pop(-1) binary_= lambda u: 0 if u == '<=50K' else 1 defs_ = [ {'age': None}, {'workclass': ['Private', '?', 'Self-emp-not-inc', 'Self-emp-inc', 'Federal-go...
{ "repo_name": "saifuddin778/pwperceptrons", "path": "datasets.py", "copies": "1", "size": "7411", "license": "mit", "hash": -538180132751841340, "line_mean": 31.9377777778, "line_max": 569, "alpha_frac": 0.4805019566, "autogenerated": false, "ratio": 3.106035205364627, "config_test": false, "...
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, space once o...
{ "repo_name": "jsilter/scipy", "path": "scipy/weave/_dumbdbm_patched.py", "copies": "15", "size": "4514", "license": "bsd-3-clause", "hash": -2137187660849858600, "line_mean": 27.3899371069, "line_max": 82, "alpha_frac": 0.5350022153, "autogenerated": false, "ratio": 3.5265625, "config_test": f...
""" A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, space once ...
{ "repo_name": "macronucleus/chromagnon", "path": "Chromagnon/Priithon/plt/dumbdbm_patched.py", "copies": "1", "size": "4286", "license": "mit", "hash": 4994364099795589000, "line_mean": 28.156462585, "line_max": 78, "alpha_frac": 0.5258982734, "autogenerated": false, "ratio": 3.507364975450082, ...
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, sp...
{ "repo_name": "nmercier/linux-cross-gcc", "path": "win32/bin/Lib/dumbdbm.py", "copies": "2", "size": "9187", "license": "bsd-3-clause", "hash": -4357775524957528000, "line_mean": 34.8955823293, "line_max": 78, "alpha_frac": 0.5720039186, "autogenerated": false, "ratio": 3.992611907866145, "conf...
"""A dummy audio actor for use in tests. This class implements the audio API in the simplest way possible. It is used in tests of the core and backends. """ from __future__ import absolute_import, unicode_literals from mopidy import audio import pykka def create_proxy(config=None, mixer=None): return DummyAud...
{ "repo_name": "rectalogic/mopidy-pandora", "path": "tests/dummy_audio.py", "copies": "2", "size": "3848", "license": "apache-2.0", "hash": 2276735564828996000, "line_mean": 27.2941176471, "line_max": 88, "alpha_frac": 0.6068087318, "autogenerated": false, "ratio": 3.9629248197734293, "config_te...
"""A dummy audio actor for use in tests. This class implements the audio API in the simplest way possible. It is used in tests of the core and backends. """ from __future__ import unicode_literals import pykka from .constants import PlaybackState from .listener import AudioListener class DummyAudio(pykka.Threadin...
{ "repo_name": "woutervanwijk/mopidy", "path": "mopidy/audio/dummy.py", "copies": "1", "size": "3097", "license": "apache-2.0", "hash": 3544604332561993700, "line_mean": 26.6517857143, "line_max": 79, "alpha_frac": 0.6131740394, "autogenerated": false, "ratio": 4.080368906455863, "config_test": ...
"""A dummy audio actor for use in tests. This class implements the audio API in the simplest way possible. It is used in tests of the core and backends. """ import pykka from mopidy import audio def create_proxy(config=None, mixer=None): return DummyAudio.start(config, mixer).proxy() # TODO: reset position ...
{ "repo_name": "jodal/mopidy", "path": "tests/dummy_audio.py", "copies": "3", "size": "3900", "license": "apache-2.0", "hash": -6468374728811022000, "line_mean": 27.2608695652, "line_max": 79, "alpha_frac": 0.5984615385, "autogenerated": false, "ratio": 3.9959016393442623, "config_test": false, ...
"""A dummy backend for use in tests. This backend implements the backend API in the simplest way possible. It is used in tests of the frontends. """ from __future__ import absolute_import, unicode_literals import pykka from mopidy import backend from mopidy.models import Playlist, Ref, SearchResult def create_du...
{ "repo_name": "priestd09/mopidy", "path": "mopidy/backend/dummy.py", "copies": "2", "size": "3068", "license": "apache-2.0", "hash": 8353517146123160000, "line_mean": 26.6396396396, "line_max": 76, "alpha_frac": 0.6398305085, "autogenerated": false, "ratio": 3.9536082474226806, "config_test": f...
"""A dummy backend for use in tests. This backend implements the backend API in the simplest way possible. It is used in tests of the frontends. """ from __future__ import unicode_literals import pykka from mopidy import backend from mopidy.models import Playlist, Ref, SearchResult def create_dummy_backend_proxy...
{ "repo_name": "woutervanwijk/mopidy", "path": "mopidy/backend/dummy.py", "copies": "3", "size": "3054", "license": "apache-2.0", "hash": 2854898147553960000, "line_mean": 26.5135135135, "line_max": 76, "alpha_frac": 0.6394891945, "autogenerated": false, "ratio": 3.9559585492227978, "config_test...
"""A dummy backend for use in tests. This backend implements the backend API in the simplest way possible. It is used in tests of the frontends. """ import pykka from mopidy import backend from mopidy.models import Playlist, Ref, SearchResult def create_proxy(config=None, audio=None): return DummyBackend.sta...
{ "repo_name": "adamcik/mopidy", "path": "tests/dummy_backend.py", "copies": "4", "size": "4258", "license": "apache-2.0", "hash": 8571851900242502000, "line_mean": 26.8300653595, "line_max": 79, "alpha_frac": 0.613903241, "autogenerated": false, "ratio": 3.9280442804428044, "config_test": false...
"""A dummy module for testing purposes.""" import logging import os import uuid import lambdautils.state as state logger = logging.getLogger() logger.setLevel(logging.INFO) def partition_key(event): return event.get("client_id", str(uuid.uuid4())) def input_filter(event, *args, **kwargs): if os.environ.g...
{ "repo_name": "humilis/humilis-kinesis-mapper", "path": "tests/integration/mycode/mypkg/__init__.py", "copies": "2", "size": "1346", "license": "mit", "hash": -6640724321236282000, "line_mean": 21.813559322, "line_max": 78, "alpha_frac": 0.6433878158, "autogenerated": false, "ratio": 3.4690721649...
# A dummy service that implements the mettle protocol for one pipeline, called # "bar". The "bar" pipeline will make targets of "tmp/<target_time>/[0-9].txt". import os import json import socket import time import random import sys from datetime import timedelta import pika import isodate import utc import yaml imp...
{ "repo_name": "yougov/mettle", "path": "scripts/pizza_service.py", "copies": "1", "size": "5305", "license": "mit", "hash": 197432441424808160, "line_mean": 31.950310559, "line_max": 80, "alpha_frac": 0.5379830349, "autogenerated": false, "ratio": 3.880760790051207, "config_test": false, "has...
#Advanced Encryption Standard from random import SystemRandom rand = SystemRandom() try: range = xrange except Exception: pass xtime = lambda x: (((x << 1) ^ 0x1b) & 0xff) if (x & 0x80) else (x << 1) SBox = [[0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76], ...
{ "repo_name": "Fitzgibbons/Cryptograpy", "path": "AES.py", "copies": "1", "size": "9274", "license": "mit", "hash": -8497146949694690000, "line_mean": 46.8041237113, "line_max": 248, "alpha_frac": 0.5258788009, "autogenerated": false, "ratio": 2.173933427097984, "config_test": false, "has_no_...
"""Advanced examples.""" import logging import os from multiprocessing import Process from time import sleep from phial import Message, Phial, Response, Schedule, command slackbot = Phial(os.getenv("SLACK_API_TOKEN", "NONE")) SCHEDULED_CHANNEL = "channel-id" @slackbot.command("cent(er|re)") def regex_in_command() -...
{ "repo_name": "sedders123/phial", "path": "examples/advanced.py", "copies": "1", "size": "3247", "license": "mit", "hash": 678805643877652400, "line_mean": 30.8333333333, "line_max": 87, "alpha_frac": 0.5897751771, "autogenerated": false, "ratio": 4.038557213930348, "config_test": false, "has...
"""Advanced example using other configuration options.""" from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from flask import Flask from flask_apscheduler import APScheduler class Config: """App configuration.""" JOBS = [ { "id": "job1", "func": "advanced:job1"...
{ "repo_name": "viniciuschiele/flask-apscheduler", "path": "examples/advanced.py", "copies": "1", "size": "1028", "license": "apache-2.0", "hash": 8727885259553075000, "line_mean": 20.4166666667, "line_max": 80, "alpha_frac": 0.5836575875, "autogenerated": false, "ratio": 3.496598639455782, "con...
#advanced feature L=[] n=1 while n<=99: L.append(n) n+=2 print(L) L=['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack'] print(L[1]) print(L[2]) print(L[3]) print(L[0:3]) r = [] k = 3 for i in range(k): r.append(L[i]) print(r) print(L[-1]) print(L[-2]) print(L[-2:-1]) print('key value------') d = {'a': 1, 'b': 2, '...
{ "repo_name": "CrazyBBer/Python-Learn-Sample", "path": "Function/advanced.py", "copies": "1", "size": "2583", "license": "mit", "hash": -4487050427185922000, "line_mean": 11.2822966507, "line_max": 46, "alpha_frac": 0.542267238, "autogenerated": false, "ratio": 2.0819140308191404, "config_test"...
# Advanced Frame Differencing Example # # Note: You will need an SD card to run this example. # # This example demonstrates using frame differencing with your OpenMV Cam. This # example is advanced because it preforms a background update to deal with the # backgound image changing overtime. import sensor, image, pyb, ...
{ "repo_name": "openmv/openmv", "path": "scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_advanced_frame_differencing.py", "copies": "2", "size": "2549", "license": "mit", "hash": 9050809899523862000, "line_mean": 41.4833333333, "line_max": 87, "alpha_frac": 0.702236171, "autogener...
# Advanced Frame Differencing Example # # This example demonstrates using frame differencing with your OpenMV Cam. This # example is advanced because it preforms a background update to deal with the # backgound image changing overtime. import sensor, image, pyb, os, time TRIGGER_THRESHOLD = 5 BG_UPDATE_FRAMES = 50 #...
{ "repo_name": "openmv/openmv", "path": "scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_advanced_frame_differencing.py", "copies": "2", "size": "2937", "license": "mit", "hash": -8568993232279012000, "line_mean": 44.890625, "line_max": 87, "alpha_frac": 0.7136533878, "autogener...
#advanced functions library from bas_lib import * from mac_lib import * import random import time import datetime import cus_lib cus_funct=cus_lib.cus_funct #tim_funct=cus_lib.tim_funct #funzioni a tempo def esegui (utente,comando,destinatario,testo): ambiente_attivo=cus_lib.ambiente_attivo #splitta testo com...
{ "repo_name": "izabera/izabot", "path": "adv_lib.py", "copies": "1", "size": "2835", "license": "mit", "hash": -4665285421567215000, "line_mean": 27.36, "line_max": 116, "alpha_frac": 0.6373897707, "autogenerated": false, "ratio": 2.6372093023255814, "config_test": true, "has_no_keywords": fa...
# ADVANCED MATH CALCULATOR v1.4 # by Raphael Gutierrez (fb.com/raphael.gutierrez.17) # Licensed under MIT (https://github.com/ralphgutz/Advanced-Python-Calculator/blob/master/LICENSE) # I wrote the codes using my basic Python knowledge to easily understand the codes. import math def basic(): print("*" * 40...
{ "repo_name": "ralphgutz/Advanced-Python-Calculator", "path": "Calculator.py", "copies": "1", "size": "16952", "license": "mit", "hash": -7667261597707341000, "line_mean": 30.8527131783, "line_max": 238, "alpha_frac": 0.5910217084, "autogenerated": false, "ratio": 2.8639972968406826, "config_te...
#This program reads a XML and writes it into a CSV #For each of those tasks there is a seperate function written. #The filename to read has to be the first argument from the command line. #The filename to write into has to be the second arguments from command line. import sys from bs4 import BeautifulSoup as Soup im...
{ "repo_name": "frodo4fingers/appfs", "path": "Jeney/02_Exercise/ex2.py", "copies": "3", "size": "2929", "license": "mit", "hash": 299876927021330940, "line_mean": 31.9101123596, "line_max": 79, "alpha_frac": 0.5821099351, "autogenerated": false, "ratio": 4.656597774244833, "config_test": false,...
# advanced_search.py import wx from pubsub import pub class AdvancedSearch(wx.Panel): def __init__(self, parent): super().__init__(parent) self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.free_text = wx.TextCtrl(self) self.ui_helper('Free text search:', self.free_text) ...
{ "repo_name": "slogan621/tscharts", "path": "apps/xrayuploader/advanced_search.py", "copies": "1", "size": "2491", "license": "apache-2.0", "hash": -8101417628134089000, "line_mean": 39.1935483871, "line_max": 73, "alpha_frac": 0.5953432356, "autogenerated": false, "ratio": 3.6524926686217007, ...
"""Advanced Settings Class.""" from fmcapi.api_objects.apiclasstemplate import APIClassTemplate from .ftds2svpns import FTDS2SVPNs import logging class AdvancedSettings(APIClassTemplate): """The AdvancedSettings Object in the FMC.""" VALID_JSON_DATA = [ "id", "name", "type", ...
{ "repo_name": "daxm/fmcapi", "path": "fmcapi/api_objects/policy_services/advancedsettings.py", "copies": "1", "size": "1750", "license": "bsd-3-clause", "hash": 765436822783422800, "line_mean": 30.8181818182, "line_max": 116, "alpha_frac": 0.5942857143, "autogenerated": false, "ratio": 3.59342915...
""" Advanced signal (e.g. ctrl+C) handling for IPython So far, this only ignores ctrl + C in IPython file a subprocess is executing, to get closer to how a "proper" shell behaves. Other signal processing may be implemented later on. If _ip.options.verbose is true, show exit status if nonzero """ import signal,os,s...
{ "repo_name": "sodafree/backend", "path": "build/ipython/IPython/quarantine/ipy_signals.py", "copies": "1", "size": "1652", "license": "bsd-3-clause", "hash": -6988002960970420000, "line_mean": 26.0819672131, "line_max": 68, "alpha_frac": 0.6761501211, "autogenerated": false, "ratio": 3.729119638...
advanced_sparta = ( # ("sensors", "keyboard"), #("sensors", "mouse"), #("sensors", "collision"), #("sensors", "near"), #("sensors", "message"), #("sensors", "random_"), #("processors", "trigger"), #("processors", "toggle"), #("processors", "switch"), #("processors", "if_"), #...
{ "repo_name": "agoose77/hivesystem", "path": "hiveguilib/HBlender/level.py", "copies": "1", "size": "2668", "license": "bsd-2-clause", "hash": -9034565752096989000, "line_mean": 23.2545454545, "line_max": 70, "alpha_frac": 0.535982009, "autogenerated": false, "ratio": 3.469440832249675, "config...
"""Advanced timeout handling. Set of helper classes to handle timeouts of tasks with advanced options like zones and freezing of timeouts. """ from __future__ import annotations import asyncio import enum from types import TracebackType from typing import Any, Dict, List, Optional, Type, Union from .async_ import ru...
{ "repo_name": "GenericStudent/home-assistant", "path": "homeassistant/util/timeout.py", "copies": "6", "size": "14604", "license": "apache-2.0", "hash": 2547671032862168600, "line_mean": 27.7480314961, "line_max": 80, "alpha_frac": 0.5780608053, "autogenerated": false, "ratio": 4.106861642294713,...
"""Advanced tools for dense recursive polynomials in ``K[x]`` or ``K[X]``.""" from .densearith import (dmp_add, dmp_add_term, dmp_div, dmp_exquo_ground, dmp_mul, dmp_mul_ground, dmp_neg, dmp_sub, dup_add, dup_mul) from .densebasic import (dmp_convert, dmp_degree_in, dm...
{ "repo_name": "skirpichev/omg", "path": "diofant/polys/densetools.py", "copies": "1", "size": "12628", "license": "bsd-3-clause", "hash": -2260708377628337700, "line_mean": 19.6339869281, "line_max": 90, "alpha_frac": 0.4302343997, "autogenerated": false, "ratio": 2.6496013428451533, "config_te...
"""Advanced tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """ from __future__ import print_function, division from sympy.core.compatibility import range from sympy.polys.densearith import ( dup_add_term, dmp_add_term, dup_lshift, dup_add, dmp_add, dup_sub, dmp_sub, dup_mul, dmp_mu...
{ "repo_name": "kaushik94/sympy", "path": "sympy/polys/densetools.py", "copies": "6", "size": "25867", "license": "bsd-3-clause", "hash": -2728441805223602000, "line_mean": 18.8062787136, "line_max": 92, "alpha_frac": 0.4559477326, "autogenerated": false, "ratio": 2.7384077916578446, "config_tes...
"""Advanced tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """ from __future__ import print_function, division from sympy.polys.densebasic import ( dup_strip, dmp_strip, dup_convert, dmp_convert, dup_degree, dmp_degree, dmp_to_dict, dmp_from_dict, dup_LC, dmp_LC, dmp_ground_LC,...
{ "repo_name": "emon10005/sympy", "path": "sympy/polys/densetools.py", "copies": "52", "size": "25854", "license": "bsd-3-clause", "hash": -8522646158824810000, "line_mean": 18.7509549274, "line_max": 92, "alpha_frac": 0.4560609577, "autogenerated": false, "ratio": 2.738771186440678, "config_tes...
"""Advanced tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """ from sympy.polys.densebasic import ( dup_strip, dmp_strip, dup_convert, dmp_convert, dup_degree, dmp_degree, dmp_degree_in, dup_to_dict, dmp_to_dict, dup_from_dict, dmp_from_dict, dup_LC, dmp_LC, dmp_ground_LC, d...
{ "repo_name": "pernici/sympy", "path": "sympy/polys/densetools.py", "copies": "1", "size": "27597", "license": "bsd-3-clause", "hash": 9168373856174546000, "line_mean": 20.7985781991, "line_max": 92, "alpha_frac": 0.4964670073, "autogenerated": false, "ratio": 2.764676417551593, "config_test": ...
"""Advanced tools for dense recursive polynomials in `K[x]` or `K[X]`. """ from sympy.polys.densebasic import ( dup_strip, dmp_strip, dup_reverse, dup_convert, dmp_convert, dup_degree, dmp_degree, dmp_degree_in, dup_to_dict, dmp_to_dict, dup_from_dict, dmp_from_dict, dup_LC, dmp_LC, dmp_gro...
{ "repo_name": "tovrstra/sympy", "path": "sympy/polys/densetools.py", "copies": "3", "size": "67487", "license": "bsd-3-clause", "hash": -9049831501624728000, "line_mean": 24.3044619423, "line_max": 105, "alpha_frac": 0.4921540445, "autogenerated": false, "ratio": 2.6799698197124933, "config_tes...