max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
test/tests.py | gzu300/Linear_Algebra | 0 | 8900 | <filename>test/tests.py
import unittest
from pkg import Linear_Algebra
import numpy as np
class TestLU(unittest.TestCase):
def setUp(self):
self.U_answer = np.around(np.array([[2,1,0],[0,3/2,1],[0,0,4/3]], dtype=float), decimals=2).tolist()
self.L_answer = np.around(np.array([[1,0,0],[1/2,1,0],[0,2... | <filename>test/tests.py
import unittest
from pkg import Linear_Algebra
import numpy as np
class TestLU(unittest.TestCase):
def setUp(self):
self.U_answer = np.around(np.array([[2,1,0],[0,3/2,1],[0,0,4/3]], dtype=float), decimals=2).tolist()
self.L_answer = np.around(np.array([[1,0,0],[1/2,1,0],[0,2... | none | 1 | 3.038956 | 3 | |
src/backend/common/models/favorite.py | ofekashery/the-blue-alliance | 266 | 8901 | from backend.common.models.mytba import MyTBAModel
class Favorite(MyTBAModel):
"""
In order to make strongly consistent DB requests, instances of this class
should be created with a parent that is the associated Account key.
"""
def __init__(self, *args, **kwargs):
super(Favorite, self)._... | from backend.common.models.mytba import MyTBAModel
class Favorite(MyTBAModel):
"""
In order to make strongly consistent DB requests, instances of this class
should be created with a parent that is the associated Account key.
"""
def __init__(self, *args, **kwargs):
super(Favorite, self)._... | en | 0.956623 | In order to make strongly consistent DB requests, instances of this class should be created with a parent that is the associated Account key. | 2.327444 | 2 |
Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/filebrowsebutton.py | MontyThibault/centre-of-mass-awareness | 27 | 8902 | #----------------------------------------------------------------------
# Name: wxPython.lib.filebrowsebutton
# Purpose: Composite controls that provide a Browse button next to
# either a wxTextCtrl or a wxComboBox. The Browse button
# launches a wxFileDialog and loads the result i... | #----------------------------------------------------------------------
# Name: wxPython.lib.filebrowsebutton
# Purpose: Composite controls that provide a Browse button next to
# either a wxTextCtrl or a wxComboBox. The Browse button
# launches a wxFileDialog and loads the result i... | en | 0.697016 | #---------------------------------------------------------------------- # Name: wxPython.lib.filebrowsebutton # Purpose: Composite controls that provide a Browse button next to # either a wxTextCtrl or a wxComboBox. The Browse button # launches a wxFileDialog and loads the result i... | 2.717795 | 3 |
modules/pygsm/devicewrapper.py | whanderley/eden | 205 | 8903 | <gh_stars>100-1000
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
# arch: pacman -S python-pyserial
# debian/ubuntu: apt-get install python-serial
import serial
import re
import errors
class DeviceWrapper(object):
def __init__(self, logger, *args, **kwargs):
self.device = serial.Se... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
# arch: pacman -S python-pyserial
# debian/ubuntu: apt-get install python-serial
import serial
import re
import errors
class DeviceWrapper(object):
def __init__(self, logger, *args, **kwargs):
self.device = serial.Serial(*args, **kwarg... | en | 0.861807 | #!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 # arch: pacman -S python-pyserial # debian/ubuntu: apt-get install python-serial Read from the modem (blocking) until _terminator_ is hit, (defaults to \r\n, which reads a single "line"), and return. # if a different timeout was requested just... | 2.622741 | 3 |
day1/loops.py | alqmy/The-Garage-Summer-Of-Code | 0 | 8904 | <gh_stars>0
# while True:
# # ejecuta esto
# print("Hola")
real = 7
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# =/=
while guess != real:
print("Ese no es el numero")
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# el resto
print("Yay! Lo sacastes!")
| # while True:
# # ejecuta esto
# print("Hola")
real = 7
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# =/=
while guess != real:
print("Ese no es el numero")
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# el resto
print("Yay! Lo sacastes!") | es | 0.695699 | # while True: # # ejecuta esto # print("Hola") # =/= # el resto | 4.034661 | 4 |
pentest-scripts/learning-python-for-forensics/Chapter 6/rot13.py | paulveillard/cybersecurity-penetration-testing | 6 | 8905 | <reponame>paulveillard/cybersecurity-penetration-testing
def rotCode(data):
"""
The rotCode function encodes/decodes data using string indexing
:param data: A string
:return: The rot-13 encoded/decoded string
"""
rot_chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'... | def rotCode(data):
"""
The rotCode function encodes/decodes data using string indexing
:param data: A string
:return: The rot-13 encoded/decoded string
"""
rot_chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', '... | en | 0.730046 | The rotCode function encodes/decodes data using string indexing :param data: A string :return: The rot-13 encoded/decoded string # Walk through each individual character # Walk through each individual character # Find the position of the character in rot_chars list # Calculate the relative index that is 13 ... | 4.375463 | 4 |
examples/sim_tfidf.py | sunyilgdx/CwVW-SIF | 12 | 8906 | <gh_stars>10-100
import pickle, sys
sys.path.append('../src')
import data_io, sim_algo, eval, params
## run
# wordfiles = [#'../data/paragram_sl999_small.txt', # need to download it from <NAME>'s github (https://github.com/jwieting/iclr2016)
# '../data/glove.840B.300d.txt' # need to download it first
# ]
wor... | import pickle, sys
sys.path.append('../src')
import data_io, sim_algo, eval, params
## run
# wordfiles = [#'../data/paragram_sl999_small.txt', # need to download it from <NAME>'s github (https://github.com/jwieting/iclr2016)
# '../data/glove.840B.300d.txt' # need to download it first
# ]
wordfiles = [#'../da... | en | 0.728266 | ## run # wordfiles = [#'../data/paragram_sl999_small.txt', # need to download it from <NAME>'s github (https://github.com/jwieting/iclr2016) # '../data/glove.840B.300d.txt' # need to download it first # ] #'../data/paragram_sl999_small.txt', # need to download it from <NAME>'s github (https://github.com/jwieti... | 2.405972 | 2 |
tests/cases/cls.py | div72/py2many | 345 | 8907 | <gh_stars>100-1000
class Foo:
def bar(self):
return "a"
if __name__ == "__main__":
f = Foo()
b = f.bar()
print(b) | class Foo:
def bar(self):
return "a"
if __name__ == "__main__":
f = Foo()
b = f.bar()
print(b) | none | 1 | 2.912009 | 3 | |
theano-rfnn/mnist_loader.py | jhja/RFNN | 55 | 8908 | <filename>theano-rfnn/mnist_loader.py
import numpy as np
import os
from random import shuffle
datasets_dir = './../data/'
def one_hot(x,n):
if type(x) == list:
x = np.array(x)
x = x.flatten()
o_h = np.zeros((len(x),n))
o_h[np.arange(len(x)),x] = 1
return o_h
def mnist(ntrain=60000,ntest=10000,onehot=True):
... | <filename>theano-rfnn/mnist_loader.py
import numpy as np
import os
from random import shuffle
datasets_dir = './../data/'
def one_hot(x,n):
if type(x) == list:
x = np.array(x)
x = x.flatten()
o_h = np.zeros((len(x),n))
o_h[np.arange(len(x)),x] = 1
return o_h
def mnist(ntrain=60000,ntest=10000,onehot=True):
... | none | 1 | 2.452466 | 2 | |
Ejercicio 2.py | crltsnch/Ejercicios-grupales | 0 | 8909 | import math
import os
import random
import re
import sys
def compareTriplets(a, b):
puntosA=0
puntosB=0
for i in range (0,3):
if a[i]<b[i]:
puntosB+=1
elif a[i]>b[i]:
puntosA+=1
puntosTotales=[puntosA, puntosB]
return puntosTotales
if __name__ == '__mai... | import math
import os
import random
import re
import sys
def compareTriplets(a, b):
puntosA=0
puntosB=0
for i in range (0,3):
if a[i]<b[i]:
puntosB+=1
elif a[i]>b[i]:
puntosA+=1
puntosTotales=[puntosA, puntosB]
return puntosTotales
if __name__ == '__mai... | none | 1 | 3.621906 | 4 | |
app/routes/router.py | nityagautam/ReportDashboard-backend | 1 | 8910 | #===============================================================
# @author: <EMAIL>
# @written: 08 December 2021
# @desc: Routes for the Backend server
#===============================================================
# Import section with referecne of entry file or main file;
from __main__ import applicatio... | #===============================================================
# @author: <EMAIL>
# @written: 08 December 2021
# @desc: Routes for the Backend server
#===============================================================
# Import section with referecne of entry file or main file;
from __main__ import applicatio... | en | 0.623894 | #=============================================================== # @author: <EMAIL> # @written: 08 December 2021 # @desc: Routes for the Backend server #=============================================================== # Import section with referecne of entry file or main file; # Local sample data import # ==========... | 2.380348 | 2 |
idaes/generic_models/properties/core/examples/ASU_PR.py | carldlaird/idaes-pse | 112 | 8911 | <filename>idaes/generic_models/properties/core/examples/ASU_PR.py
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energ... | <filename>idaes/generic_models/properties/core/examples/ASU_PR.py
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energ... | en | 0.74351 | ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar... | 2.003432 | 2 |
tests/functional/test_calculator.py | bellanov/calculator | 0 | 8912 | """TODO: Move the Threads Here"""
| """TODO: Move the Threads Here"""
| en | 0.290964 | TODO: Move the Threads Here | 1.05305 | 1 |
autokeras/hypermodel/graph.py | Sette/autokeras | 0 | 8913 | <reponame>Sette/autokeras
import functools
import pickle
import kerastuner
import tensorflow as tf
from tensorflow.python.util import nest
from autokeras.hypermodel import base
from autokeras.hypermodel import compiler
class Graph(kerastuner.engine.stateful.Stateful):
"""A graph consists of connected Blocks, Hy... | import functools
import pickle
import kerastuner
import tensorflow as tf
from tensorflow.python.util import nest
from autokeras.hypermodel import base
from autokeras.hypermodel import compiler
class Graph(kerastuner.engine.stateful.Stateful):
"""A graph consists of connected Blocks, HyperBlocks, Preprocessors o... | en | 0.782003 | A graph consists of connected Blocks, HyperBlocks, Preprocessors or Heads. # Arguments inputs: A list of input node(s) for the Graph. outputs: A list of output node(s) for the Graph. override_hps: A list of HyperParameters. The predefined HyperParameters that will override the s... | 2.745121 | 3 |
Python/longest-valid-parentheses.py | shreyventure/LeetCode-Solutions | 388 | 8914 | '''
Speed: 95.97%
Memory: 24.96%
Time complexity: O(n)
Space complexity: O(n)
'''
class Solution(object):
def longestValidParentheses(self, s):
ans=0
stack=[-1]
for i in range(len(s)):
if(s[i]=='('):
stack.append(i)
else:
stack.pop()
... | '''
Speed: 95.97%
Memory: 24.96%
Time complexity: O(n)
Space complexity: O(n)
'''
class Solution(object):
def longestValidParentheses(self, s):
ans=0
stack=[-1]
for i in range(len(s)):
if(s[i]=='('):
stack.append(i)
else:
stack.pop()
... | en | 0.806613 | Speed: 95.97% Memory: 24.96% Time complexity: O(n) Space complexity: O(n) | 3.479942 | 3 |
setup.py | i25ffz/openaes | 0 | 8915 | <reponame>i25ffz/openaes
from distutils.core import setup, Extension
import os.path
kw = {
'name':"PyOpenAES",
'version':"0.10.0",
'description':"OpenAES cryptographic library for Python.",
'ext_modules':[
Extension(
'openaes',
include_dirs = ['inc', 'src/isaac'],
# define_macros=[('ENABLE_PYTHON', '1')... | from distutils.core import setup, Extension
import os.path
kw = {
'name':"PyOpenAES",
'version':"0.10.0",
'description':"OpenAES cryptographic library for Python.",
'ext_modules':[
Extension(
'openaes',
include_dirs = ['inc', 'src/isaac'],
# define_macros=[('ENABLE_PYTHON', '1')],
sources = [
os.... | it | 0.148557 | # define_macros=[('ENABLE_PYTHON', '1')], | 1.283661 | 1 |
examples/isosurface_demo2.py | jayvdb/scitools | 62 | 8916 | #!/usr/bin/env python
# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html
from scitools.easyviz import *
from time import sleep
from scipy import io
setp(interactive=False)
# Displaying an Isosurface:
mri = io.loadmat('mri_matlab_v6.mat')
D = mri['D']
#Ds = smooth3(D... | #!/usr/bin/env python
# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html
from scitools.easyviz import *
from time import sleep
from scipy import io
setp(interactive=False)
# Displaying an Isosurface:
mri = io.loadmat('mri_matlab_v6.mat')
D = mri['D']
#Ds = smooth3(D... | en | 0.388866 | #!/usr/bin/env python # Example taken from: # http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html # Displaying an Isosurface: #Ds = smooth3(D); #hiso = isosurface(Ds,5), # 'FaceColor',[1,.75,.65],... # 'EdgeColor','none'); # Adding an Isocap to Show a Cutaway Surface: #hcap = patch(isocaps(D,5)... | 2.55106 | 3 |
structural_model/util_morphology.py | zibneuro/udvary-et-al-2022 | 1 | 8917 | <gh_stars>1-10
import os
import numpy as np
import json
import util_amira
def getEdgeLabelName(label):
if(label == 6):
return "axon"
elif(label == 4):
return "apical"
elif(label == 5):
return "basal"
elif(label == 7):
return "soma"
else:
return "other"
def... | import os
import numpy as np
import json
import util_amira
def getEdgeLabelName(label):
if(label == 6):
return "axon"
elif(label == 4):
return "apical"
elif(label == 5):
return "basal"
elif(label == 7):
return "soma"
else:
return "other"
def getSomaPositio... | none | 1 | 2.742996 | 3 | |
invenio_madmp/views.py | FAIR-Data-Austria/invenio-madmp | 1 | 8918 | """Blueprint definitions for maDMP integration."""
from flask import Blueprint, jsonify, request
from invenio_db import db
from .convert import convert_dmp
from .models import DataManagementPlan
def _summarize_dmp(dmp: DataManagementPlan) -> dict:
"""Create a summary dictionary for the given DMP."""
res = {... | """Blueprint definitions for maDMP integration."""
from flask import Blueprint, jsonify, request
from invenio_db import db
from .convert import convert_dmp
from .models import DataManagementPlan
def _summarize_dmp(dmp: DataManagementPlan) -> dict:
"""Create a summary dictionary for the given DMP."""
res = {... | en | 0.768715 | Blueprint definitions for maDMP integration. Create a summary dictionary for the given DMP. Create the blueprint for the REST endpoints using the current app extensions. # note: using flask.current_app isn't directly possible, because Invenio-MaDMP is # registered as an extension in the API app, not the "normal" ... | 2.51376 | 3 |
retrieval/urls.py | aipassio/visual_retrieval | 0 | 8919 | <gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('retrieval_insert', views.retrieval_insert, name='retrieval_insert'),
path('retrieval_get', views.retrieval_get, name='retrieval_get')
] | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('retrieval_insert', views.retrieval_insert, name='retrieval_insert'),
path('retrieval_get', views.retrieval_get, name='retrieval_get')
] | none | 1 | 1.656419 | 2 | |
scripts/Interfacing/encoder_class.py | noshluk2/Wifi-Signal-Robot-localization | 0 | 8920 | <reponame>noshluk2/Wifi-Signal-Robot-localization<filename>scripts/Interfacing/encoder_class.py
import RPi.GPIO as GPIO
import threading
class Encoder(object):
def __init__(self, r_en_a,r_en_b,l_en_a,l_en_b):
GPIO.setmode(GPIO.BCM)
GPIO.setup(r_en_a, GPIO.IN)
GPIO.setup(r_en_b, GPIO.IN)
... | import RPi.GPIO as GPIO
import threading
class Encoder(object):
def __init__(self, r_en_a,r_en_b,l_en_a,l_en_b):
GPIO.setmode(GPIO.BCM)
GPIO.setup(r_en_a, GPIO.IN)
GPIO.setup(r_en_b, GPIO.IN)
GPIO.setup(l_en_a, GPIO.IN)
GPIO.setup(l_en_b, GPIO.IN)
self.l_en_a=l_en_a;... | es | 0.094661 | # r_en_a = 27 # r_en_b = 10 # l_en_a = 5 # l_en_b = 6 # enc_obj = Encoder(27,10,5,6) # def update_encoders(): # threading.Timer(1,update_encoders).start() # print(" looping ") # update_encoders() | 2.770159 | 3 |
systori/apps/equipment/urls.py | systori/systori | 12 | 8921 | <filename>systori/apps/equipment/urls.py
from django.conf.urls import url
from django.urls import path, include
from systori.apps.user.authorization import office_auth
from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, Refu... | <filename>systori/apps/equipment/urls.py
from django.conf.urls import url
from django.urls import path, include
from systori.apps.user.authorization import office_auth
from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, Refu... | en | 0.686743 | # two url rules to make the active_filter keyword optional | 2.071165 | 2 |
40_3.py | rursvd/pynumerical2 | 0 | 8922 | <reponame>rursvd/pynumerical2<gh_stars>0
from numpy import zeros
# Define ab2 function
def ab2(f,t0,tf,y0,n):
h = (tf - t0)/n
t = zeros(n+1)
y = zeros(n+1)
t[0] = t0
y[0] = y0
y[1] = y[0] + h * f(t[0],y[0])
t[1] = t[0] + h
for i in range(1,n):
y[i+1] = y[i] + (3.0/2.0) ... | from numpy import zeros
# Define ab2 function
def ab2(f,t0,tf,y0,n):
h = (tf - t0)/n
t = zeros(n+1)
y = zeros(n+1)
t[0] = t0
y[0] = y0
y[1] = y[0] + h * f(t[0],y[0])
t[1] = t[0] + h
for i in range(1,n):
y[i+1] = y[i] + (3.0/2.0) * h * f(t[i],y[i])-1.0/2.0 * h * f(t[i-1]... | en | 0.49442 | # Define ab2 function # Define functions # Set initial conditions # Execute AB2 # Print results | 3.163809 | 3 |
test/test_parse_cs.py | NeonDaniel/lingua-franca | 0 | 8923 | <reponame>NeonDaniel/lingua-franca
#
# Copyright 2017 Mycroft AI Inc.
#
# 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 ... | #
# Copyright 2017 Mycroft AI Inc.
#
# 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 agreed to in writ... | en | 0.709948 | # # Copyright 2017 Mycroft AI Inc. # # 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 agreed to in writ... | 2.159079 | 2 |
src/net/pluto_ftp.py | WardenAllen/Uranus | 0 | 8924 | <gh_stars>0
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2020/9/18 12:02
# @Author : WardenAllen
# @File : pluto_ftp.py
# @Brief :
import paramiko
class PlutoFtp :
# paramiko's Sftp() object.
__sftp = object
def connect_by_pass(self, host, port, uname, pwd):
transport = paramik... | # !/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2020/9/18 12:02
# @Author : WardenAllen
# @File : pluto_ftp.py
# @Brief :
import paramiko
class PlutoFtp :
# paramiko's Sftp() object.
__sftp = object
def connect_by_pass(self, host, port, uname, pwd):
transport = paramiko.Transport(... | en | 0.2787 | # !/usr/bin/python # -*- coding: utf-8 -*- # @Time : 2020/9/18 12:02 # @Author : WardenAllen # @File : pluto_ftp.py # @Brief : # paramiko's Sftp() object. | 2.564565 | 3 |
piped/processors/test/__init__.py | alexbrasetvik/Piped | 3 | 8925 | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
| # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
| en | 0.733711 | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. | 0.822658 | 1 |
assistance_bot/app.py | reakfog/personal_computer_voice_assistant | 0 | 8926 | import sys
sys.path = ['', '..'] + sys.path[1:]
import daemon
from assistance_bot import core
from functionality.voice_processing import speaking, listening
from functionality.commands import *
if __name__ == '__main__':
speaking.setup_assistant_voice(core.ttsEngine, core.assistant)
while True:
# st... | import sys
sys.path = ['', '..'] + sys.path[1:]
import daemon
from assistance_bot import core
from functionality.voice_processing import speaking, listening
from functionality.commands import *
if __name__ == '__main__':
speaking.setup_assistant_voice(core.ttsEngine, core.assistant)
while True:
# st... | en | 0.920817 | # start speech recording and speech recognition # executing the given command | 2.320129 | 2 |
python/testData/resolve/AssignmentExpressionsAndOuterVar.py | tgodzik/intellij-community | 2 | 8927 | <filename>python/testData/resolve/AssignmentExpressionsAndOuterVar.py<gh_stars>1-10
total = 0
partial_sums = [total := total + v for v in values]
print("Total:", total)
<ref> | <filename>python/testData/resolve/AssignmentExpressionsAndOuterVar.py<gh_stars>1-10
total = 0
partial_sums = [total := total + v for v in values]
print("Total:", total)
<ref> | none | 1 | 1.879771 | 2 | |
exhale/deploy.py | florianhumblot/exhale | 0 | 8928 | <reponame>florianhumblot/exhale
# -*- coding: utf8 -*-
########################################################################################
# This file is part of exhale. Copyright (c) 2017-2022, <NAME>. #
# Full BSD 3-Clause license available here: #
# ... | # -*- coding: utf8 -*-
########################################################################################
# This file is part of exhale. Copyright (c) 2017-2022, <NAME>. #
# Full BSD 3-Clause license available here: #
# ... | en | 0.813935 | # -*- coding: utf8 -*- ######################################################################################## # This file is part of exhale. Copyright (c) 2017-2022, <NAME>. # # Full BSD 3-Clause license available here: # # ... | 1.833337 | 2 |
src/bayesian_reliability_comparison.py | rloganiv/bayesian-blackbox | 8 | 8929 | import argparse
import multiprocessing
import os
import random
import numpy as np
from data_utils import DATAFILE_LIST, DATASET_LIST, prepare_data, RESULTS_DIR
from models import SumOfBetaEce
random.seed(2020)
num_cores = multiprocessing.cpu_count()
NUM_BINS = 10
NUM_RUNS = 100
N_list = [100, 200, 500, 1000, 2000, 5... | import argparse
import multiprocessing
import os
import random
import numpy as np
from data_utils import DATAFILE_LIST, DATASET_LIST, prepare_data, RESULTS_DIR
from models import SumOfBetaEce
random.seed(2020)
num_cores = multiprocessing.cpu_count()
NUM_BINS = 10
NUM_RUNS = 100
N_list = [100, 200, 500, 1000, 2000, 5... | en | 0.603182 | # load data # train a ground_truth ece model | 2.246533 | 2 |
psyneulink/core/components/functions/statefulfunctions/statefulfunction.py | SamKG/PsyNeuLink | 0 | 8930 | <gh_stars>0
#
# Princeton University licenses this file to You 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 agree... | #
# Princeton University licenses this file to You 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 agreed to in writ... | en | 0.709836 | # # Princeton University licenses this file to You 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 agreed to in writ... | 1.634889 | 2 |
ee/clickhouse/sql/person.py | wanderlog/posthog | 0 | 8931 | <reponame>wanderlog/posthog<gh_stars>0
from ee.clickhouse.sql.clickhouse import KAFKA_COLUMNS, STORAGE_POLICY, kafka_engine
from ee.clickhouse.sql.table_engines import CollapsingMergeTree, ReplacingMergeTree
from ee.kafka_client.topics import KAFKA_PERSON, KAFKA_PERSON_DISTINCT_ID, KAFKA_PERSON_UNIQUE_ID
from posthog.s... | from ee.clickhouse.sql.clickhouse import KAFKA_COLUMNS, STORAGE_POLICY, kafka_engine
from ee.clickhouse.sql.table_engines import CollapsingMergeTree, ReplacingMergeTree
from ee.kafka_client.topics import KAFKA_PERSON, KAFKA_PERSON_DISTINCT_ID, KAFKA_PERSON_UNIQUE_ID
from posthog.settings import CLICKHOUSE_CLUSTER, CLIC... | en | 0.549685 | CREATE TABLE IF NOT EXISTS {table_name} ON CLUSTER '{cluster}' ( id UUID, created_at DateTime64, team_id Int64, properties VARCHAR, is_identified Int8, is_deleted Int8 DEFAULT 0 {extra_fields} ) ENGINE = {engine} Order By (team_id, id) {storage_policy} # You must include the database here be... | 1.918971 | 2 |
scripts/dump_training_data.py | davmre/sigvisa | 0 | 8932 | from sigvisa.learn.train_coda_models import get_shape_training_data
import numpy as np
X, y, evids = get_shape_training_data(runid=4, site="AS12", chan="SHZ", band="freq_2.0_3.0", phases=["P",], target="amp_transfer", max_acost=np.float("inf"), min_amp=-2)
np.savetxt("X.txt", X)
np.savetxt("y.txt", y)
np.savetxt("evid... | from sigvisa.learn.train_coda_models import get_shape_training_data
import numpy as np
X, y, evids = get_shape_training_data(runid=4, site="AS12", chan="SHZ", band="freq_2.0_3.0", phases=["P",], target="amp_transfer", max_acost=np.float("inf"), min_amp=-2)
np.savetxt("X.txt", X)
np.savetxt("y.txt", y)
np.savetxt("evid... | none | 1 | 2.50322 | 3 | |
shdw/tools/welford.py | wbrandenburger/ShadowDetection | 2 | 8933 | <gh_stars>1-10
import math
import numpy as np
# plt.style.use('seaborn')
# plt.rcParams['figure.figsize'] = (12, 8)
def welford(x_array):
k = 0
M = 0
S = 0
for x in x_array:
k += 1
Mnext = M + (x - M) / k
S = S + (x - M)*(x - Mnext)
M = Mnext
return (M, S/(k-1))
... | import math
import numpy as np
# plt.style.use('seaborn')
# plt.rcParams['figure.figsize'] = (12, 8)
def welford(x_array):
k = 0
M = 0
S = 0
for x in x_array:
k += 1
Mnext = M + (x - M) / k
S = S + (x - M)*(x - Mnext)
M = Mnext
return (M, S/(k-1))
class Welford(... | en | 0.627246 | # plt.style.use('seaborn') # plt.rcParams['figure.figsize'] = (12, 8) Implements Welford's algorithm for computing a running mean and standard deviation as described at: http://www.johndcook.com/standard_deviation.html can take single values or iterables Properties: mean - returns the me... | 3.614472 | 4 |
day3/functions.py | lilbond/bitis | 0 | 8934 |
def greet():
print("Hi")
def greet_again(message):
print(message)
def greet_again_with_type(message):
print(type(message))
print(message)
greet()
greet_again("Hello Again")
greet_again_with_type("One Last Time")
greet_again_with_type(1234)
# multiple types
def multiple_types(x):
if x < 0:
... |
def greet():
print("Hi")
def greet_again(message):
print(message)
def greet_again_with_type(message):
print(type(message))
print(message)
greet()
greet_again("Hello Again")
greet_again_with_type("One Last Time")
greet_again_with_type(1234)
# multiple types
def multiple_types(x):
if x < 0:
... | en | 0.323683 | # multiple types # variable arguments # args will be tuples containing all the values # expanding | 3.992867 | 4 |
test.py | KipCrossing/Micropython-AD9833 | 11 | 8935 | from ad9833 import AD9833
# DUMMY classes for testing without board
class SBI(object):
def __init__(self):
pass
def send(self, data):
print(data)
class Pin(object):
def __init__(self):
pass
def low(self):
print(" 0")
def high(self):
prin... | from ad9833 import AD9833
# DUMMY classes for testing without board
class SBI(object):
def __init__(self):
pass
def send(self, data):
print(data)
class Pin(object):
def __init__(self):
pass
def low(self):
print(" 0")
def high(self):
prin... | en | 0.744146 | # DUMMY classes for testing without board # Code | 3.008584 | 3 |
tests/test_api_network.py | devicehive/devicehive-plugin-python-template | 0 | 8936 | # Copyright (C) 2018 DataArt
#
# 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 agreed to in writing, ... | # Copyright (C) 2018 DataArt
#
# 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 agreed to in writing, ... | en | 0.632191 | # Copyright (C) 2018 DataArt # # 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 agreed to in writing, ... | 1.735289 | 2 |
filehandler.py | miciux/telegram-bot-admin | 1 | 8937 | <filename>filehandler.py
import logging
import abstracthandler
import os
class FileHandler(abstracthandler.AbstractHandler):
def __init__(self, conf, bot):
abstracthandler.AbstractHandler.__init__(self, 'file', conf, bot)
self.log = logging.getLogger(__name__)
self.commands={}
self... | <filename>filehandler.py
import logging
import abstracthandler
import os
class FileHandler(abstracthandler.AbstractHandler):
def __init__(self, conf, bot):
abstracthandler.AbstractHandler.__init__(self, 'file', conf, bot)
self.log = logging.getLogger(__name__)
self.commands={}
self... | none | 1 | 2.864282 | 3 | |
tensorflow_federated/python/learning/federated_evaluation.py | Tensorflow-Devs/federated | 0 | 8938 | <reponame>Tensorflow-Devs/federated<filename>tensorflow_federated/python/learning/federated_evaluation.py
# Copyright 2019, The TensorFlow Federated Authors.
#
# 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 ... | # Copyright 2019, The TensorFlow Federated Authors.
#
# 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 o... | en | 0.814118 | # Copyright 2019, The TensorFlow Federated Authors. # # 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 o... | 1.871156 | 2 |
pylibcontainer/image.py | joaompinto/pylibcontainer | 7 | 8939 | from __future__ import print_function
import os
import shutil
import hashlib
import requests
import click
from tempfile import NamedTemporaryFile
from hashlib import sha256
from os.path import expanduser, join, exists, basename
from .utils import HumanSize
from .tar import extract_layer
from . import trust
from . impor... | from __future__ import print_function
import os
import shutil
import hashlib
import requests
import click
from tempfile import NamedTemporaryFile
from hashlib import sha256
from os.path import expanduser, join, exists, basename
from .utils import HumanSize
from .tar import extract_layer
from . import trust
from . impor... | en | 0.890305 | Provides an image caching mechanism on disk return info for cached file put a file into cache Download image (if not found in cache) and return it's filename # Check if image is on cache # Not cached, and no valid remote information was found # Dowload image # Verify image integrity | 2.370055 | 2 |
utest/test_compareimage.py | michel117/robotframework-doctestlibrary | 1 | 8940 | from DocTest.CompareImage import CompareImage
import pytest
from pathlib import Path
import numpy
def test_single_png(testdata_dir):
img = CompareImage(testdata_dir / 'text_big.png')
assert len(img.opencv_images)==1
assert type(img.opencv_images)==list
type(img.opencv_images[0])==numpy.ndarray
def tes... | from DocTest.CompareImage import CompareImage
import pytest
from pathlib import Path
import numpy
def test_single_png(testdata_dir):
img = CompareImage(testdata_dir / 'text_big.png')
assert len(img.opencv_images)==1
assert type(img.opencv_images)==list
type(img.opencv_images[0])==numpy.ndarray
def tes... | none | 1 | 2.301733 | 2 | |
cvstudio/view/widgets/labels_tableview/__init__.py | haruiz/PytorchCvStudio | 32 | 8941 | <reponame>haruiz/PytorchCvStudio<gh_stars>10-100
from .labels_tableview import LabelsTableView
| from .labels_tableview import LabelsTableView | none | 1 | 1.087449 | 1 | |
experiments/solve_different_methods.py | vishalbelsare/ags_nlp_solver | 8 | 8942 | import functools
import numpy as np
import math
import argparse
import ags_solver
import go_problems
import nlopt
import sys
from Simple import SimpleTuner
import itertools
from scipy.spatial import Delaunay
from scipy.optimize import differential_evolution
from scipy.optimize import basinhopping
from sdaopt import sda... | import functools
import numpy as np
import math
import argparse
import ags_solver
import go_problems
import nlopt
import sys
from Simple import SimpleTuner
import itertools
from scipy.spatial import Delaunay
from scipy.optimize import differential_evolution
from scipy.optimize import basinhopping
from sdaopt import sda... | en | 0.417197 | #self.solver.SetProblem(problem) #calcCounters = self.solver.GetCalculationsStatistics() #pop_size = self.class_name2params(self.class_name) # Genome instance # The evaluator function (objective function) # Genetic Algorithm Instance # Do the evolution, with stats dump # frequency of 10 generations # Best individual # ... | 1.87621 | 2 |
src/py/fc.py | mattyschell/geodatabase-toiler | 0 | 8943 | import arcpy
import logging
import pathlib
import subprocess
import gdb
import cx_sde
class Fc(object):
def __init__(self
,gdb
,name):
# gdb object
self.gdb = gdb
# ex BUILDING
self.name = name.upper()
# esri tools usually expect this C:/s... | import arcpy
import logging
import pathlib
import subprocess
import gdb
import cx_sde
class Fc(object):
def __init__(self
,gdb
,name):
# gdb object
self.gdb = gdb
# ex BUILDING
self.name = name.upper()
# esri tools usually expect this C:/s... | en | 0.676589 | # gdb object # ex BUILDING # esri tools usually expect this C:/sdefiles/bldg.sde/BUILDING # also acceptable: C:/sdefiles/bldg.sde/BLDG.BUILDING # disable archving and axe the _H table # "True A schema lock can be applied to the dataset" # could also work with resobject.status # https://pro.arcgis.com/en/pro-app/tool-re... | 2.013435 | 2 |
desafiosCursoEmVideo/ex004.py | gomesGabriel/Pythonicos | 1 | 8944 | <reponame>gomesGabriel/Pythonicos
n = input('Digite algo: ')
print('O tipo primitivo da variável é: ', type(n))
print('O que foi digitado é alfa numérico? ', n.isalnum())
print('O que foi digitado é alfabético? ', n.isalpha())
print('O que foi digitado é um decimal? ', n.isdecimal())
print('O que foi digitado é minúscu... | n = input('Digite algo: ')
print('O tipo primitivo da variável é: ', type(n))
print('O que foi digitado é alfa numérico? ', n.isalnum())
print('O que foi digitado é alfabético? ', n.isalpha())
print('O que foi digitado é um decimal? ', n.isdecimal())
print('O que foi digitado é minúsculo? ', n.islower())
print('O que f... | none | 1 | 3.960602 | 4 | |
Machine learning book/3 - MultiLayer Perceptron/test_regression.py | dalmia/Lisa-Lab-Tutorials | 25 | 8945 | <reponame>dalmia/Lisa-Lab-Tutorials
from numpy import *
import numpy as np
import matplotlib.pyplot as plt
from mlp import mlp
x = ones((1, 40)) * linspace(0, 1, 40)
t = sin(2 * pi * x) + cos(2 * pi * x) + np.random.randn(40) * 0.2
x = transpose(x)
t = transpose(t)
n_hidden = 3
eta = 0.25
n_iterations = 101
plt.plot... | from numpy import *
import numpy as np
import matplotlib.pyplot as plt
from mlp import mlp
x = ones((1, 40)) * linspace(0, 1, 40)
t = sin(2 * pi * x) + cos(2 * pi * x) + np.random.randn(40) * 0.2
x = transpose(x)
t = transpose(t)
n_hidden = 3
eta = 0.25
n_iterations = 101
plt.plot(x, t, '.')
plt.show()
train = x[0:... | none | 1 | 3.054425 | 3 | |
gomoku/networks/__init__.py | IllIIIllll/reinforcement-learning-omok | 1 | 8946 | # © 2020 지성. all rights reserved.
# <<EMAIL>>
# Apache License 2.0
from .small import *
from .medium import *
from .large import * | # © 2020 지성. all rights reserved.
# <<EMAIL>>
# Apache License 2.0
from .small import *
from .medium import *
from .large import * | en | 0.684195 | # © 2020 지성. all rights reserved. # <<EMAIL>> # Apache License 2.0 | 1.168448 | 1 |
alipay/aop/api/domain/AlipayEbppInvoiceAuthSignModel.py | snowxmas/alipay-sdk-python-all | 1 | 8947 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppInvoiceAuthSignModel(object):
def __init__(self):
self._authorization_type = None
self._m_short_name = None
self._user_id = None
@property
def authoriza... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppInvoiceAuthSignModel(object):
def __init__(self):
self._authorization_type = None
self._m_short_name = None
self._user_id = None
@property
def authoriza... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.112913 | 2 |
sdk/python/tekton_pipeline/models/v1beta1_embedded_task.py | jmcshane/experimental | 0 | 8948 | # Copyright 2020 The Tekton Authors
#
# 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 agreed to in wr... | # Copyright 2020 The Tekton Authors
#
# 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 agreed to in wr... | en | 0.654171 | # Copyright 2020 The Tekton Authors # # 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 agreed to in wr... | 1.564201 | 2 |
tzp.py | gmlunesa/zhat | 1 | 8949 | <filename>tzp.py
import zmq
import curses
import argparse
import configparser
import threading
import time
from curses import wrapper
from client import Client
from ui import UI
def parse_args():
parser = argparse.ArgumentParser(description='Client for teezeepee')
# Please specify your username
parser.... | <filename>tzp.py
import zmq
import curses
import argparse
import configparser
import threading
import time
from curses import wrapper
from client import Client
from ui import UI
def parse_args():
parser = argparse.ArgumentParser(description='Client for teezeepee')
# Please specify your username
parser.... | en | 0.192563 | # Please specify your username # Short pause | 2.421252 | 2 |
anonlink-entity-service/backend/entityservice/tasks/solver.py | Sam-Gresh/linkage-agent-tools | 1 | 8950 | <gh_stars>1-10
import anonlink
from anonlink.candidate_generation import _merge_similarities
from entityservice.object_store import connect_to_object_store
from entityservice.async_worker import celery, logger
from entityservice.settings import Config as config
from entityservice.tasks.base_task import TracedTask
from... | import anonlink
from anonlink.candidate_generation import _merge_similarities
from entityservice.object_store import connect_to_object_store
from entityservice.async_worker import celery, logger
from entityservice.settings import Config as config
from entityservice.tasks.base_task import TracedTask
from entityservice.... | en | 0.574558 | # TODO use public interface when available # https://github.com/data61/anonlink/issues/271 | 2.03597 | 2 |
portal/migrations/0007_auto_20170824_1341.py | nickmvincent/ugc-val-est | 2 | 8951 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-24 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0006_auto_20170824_0950'),
]
operations = [
migrations.AddField(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-24 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0006_auto_20170824_0950'),
]
operations = [
migrations.AddField(
... | en | 0.755624 | # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-24 13:41 | 1.735333 | 2 |
exercise-09/programming_assignment/hopfield.py | AleRiccardi/technical-neural-network-course | 0 | 8952 | <filename>exercise-09/programming_assignment/hopfield.py
import numpy as np
import random
letter_C = np.array([
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 1],
])
noisy_C = np.array([
[1, 1, 1, 1, 1],
[0, 1, 0, 0, 1],
[1, 0, 0, 0, 0],
[1, 0, 0, 1... | <filename>exercise-09/programming_assignment/hopfield.py
import numpy as np
import random
letter_C = np.array([
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 1],
])
noisy_C = np.array([
[1, 1, 1, 1, 1],
[0, 1, 0, 0, 1],
[1, 0, 0, 0, 0],
[1, 0, 0, 1... | en | 0.707752 | # check right number of pattern # loop per every pattern # loop until the state # stay the same # print energy # print char # loop per every neuron # check if the new state differs from the previous one # check if correct sequence | 3.266651 | 3 |
util/infoclient/test_infoclient.py | cdla/murfi2 | 7 | 8953 |
from infoclientLib import InfoClient
ic = InfoClient('localhost', 15002, 'localhost', 15003)
ic.add('roi-weightedave', 'active')
ic.start()
|
from infoclientLib import InfoClient
ic = InfoClient('localhost', 15002, 'localhost', 15003)
ic.add('roi-weightedave', 'active')
ic.start()
| none | 1 | 1.617871 | 2 | |
lrtc_lib/experiment_runners/experiment_runner.py | MovestaDev/low-resource-text-classification-framework | 57 | 8954 | <gh_stars>10-100
# (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import abc
import logging
import time
from collections import defaultdict
from typing import List
import numpy as np
from dataclasses import dataclass
logging.basicConfig(le... | # (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import abc
import logging
import time
from collections import defaultdict
from typing import List
import numpy as np
from dataclasses import dataclass
logging.basicConfig(level=logging.INFO,... | en | 0.820455 | # (c) Copyright IBM Corporation 2020. # LICENSE: Apache License 2.0 (Apache-2.0) # http://www.apache.org/licenses/LICENSE-2.0 Init the ExperimentsRunner :param first_model_positives_num: the number of positives instances to provide for the first model. :param first_model_negatives_num: the number of neg... | 1.591558 | 2 |
contrast/environment/data.py | alexbjorling/acquisition-framework | 0 | 8955 | <gh_stars>0
try:
from tango import DeviceProxy, DevError
except ModuleNotFoundError:
pass
class PathFixer(object):
"""
Basic pathfixer which takes a path manually.
"""
def __init__(self):
self.directory = None
class SdmPathFixer(object):
"""
MAX IV pathfixer which takes a pat... | try:
from tango import DeviceProxy, DevError
except ModuleNotFoundError:
pass
class PathFixer(object):
"""
Basic pathfixer which takes a path manually.
"""
def __init__(self):
self.directory = None
class SdmPathFixer(object):
"""
MAX IV pathfixer which takes a path from a Tan... | en | 0.938478 | Basic pathfixer which takes a path manually. MAX IV pathfixer which takes a path from a Tango device. | 2.505715 | 3 |
game_2048/views.py | fung04/csrw_game | 0 | 8956 | import json
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.shortcuts import redirect, render
from .models import Game2048
# Create your views here.
# test_user
# 8!S#5RP!WVMACg
def game(request):
return render(request, 'game_2048/index.html')
def set_result(req... | import json
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.shortcuts import redirect, render
from .models import Game2048
# Create your views here.
# test_user
# 8!S#5RP!WVMACg
def game(request):
return render(request, 'game_2048/index.html')
def set_result(req... | en | 0.751943 | # Create your views here. # test_user # 8!S#5RP!WVMACg # Get the game state from the POST request # Check if the game state idendical to the server game state # let string to JSON object # extract value of best from JSON objest # save JSON object to game_state # Check if user is logged in if not set user to test_user | 2.396149 | 2 |
distdeepq/__init__.py | Silvicek/distributional-dqn | 131 | 8957 | from distdeepq import models # noqa
from distdeepq.build_graph import build_act, build_train # noqa
from distdeepq.simple import learn, load, make_session # noqa
from distdeepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer # noqa
from distdeepq.static import *
from distdeepq.plots import PlotMachine
| from distdeepq import models # noqa
from distdeepq.build_graph import build_act, build_train # noqa
from distdeepq.simple import learn, load, make_session # noqa
from distdeepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer # noqa
from distdeepq.static import *
from distdeepq.plots import PlotMachine
| uz | 0.447735 | # noqa # noqa # noqa # noqa | 1.200001 | 1 |
python/10.Authentication-&-API-Keys.py | 17nikhil/codecademy | 0 | 8958 | # Authentication & API Keys
# Many APIs require an API key. Just as a real-world key allows you to access something, an API key grants you access to a particular API. Moreover, an API key identifies you to the API, which helps the API provider keep track of how their service is used and prevent unauthorized or maliciou... | # Authentication & API Keys
# Many APIs require an API key. Just as a real-world key allows you to access something, an API key grants you access to a particular API. Moreover, an API key identifies you to the API, which helps the API provider keep track of how their service is used and prevent unauthorized or maliciou... | en | 0.954527 | # Authentication & API Keys # Many APIs require an API key. Just as a real-world key allows you to access something, an API key grants you access to a particular API. Moreover, an API key identifies you to the API, which helps the API provider keep track of how their service is used and prevent unauthorized or maliciou... | 2.135496 | 2 |
plucker/__init__.py | takkaria/json-plucker | 0 | 8959 | <filename>plucker/__init__.py
from .plucker import pluck, Path
from .exceptions import PluckError
__all__ = ["pluck", "Path", "PluckError"]
| <filename>plucker/__init__.py
from .plucker import pluck, Path
from .exceptions import PluckError
__all__ = ["pluck", "Path", "PluckError"]
| none | 1 | 1.680164 | 2 | |
arviz/plots/pairplot.py | gimbo/arviz | 0 | 8960 | <reponame>gimbo/arviz<filename>arviz/plots/pairplot.py<gh_stars>0
"""Plot a scatter or hexbin of sampled parameters."""
import warnings
import numpy as np
from ..data import convert_to_dataset, convert_to_inference_data
from .plot_utils import xarray_to_ndarray, get_coords, get_plotting_function
from ..utils import _v... | """Plot a scatter or hexbin of sampled parameters."""
import warnings
import numpy as np
from ..data import convert_to_dataset, convert_to_inference_data
from .plot_utils import xarray_to_ndarray, get_coords, get_plotting_function
from ..utils import _var_names
def plot_pair(
data,
group="posterior",
var... | en | 0.494177 | Plot a scatter or hexbin of sampled parameters. Plot a scatter or hexbin matrix of the sampled parameters. Parameters ---------- data : obj Any object that can be converted to an az.InferenceData object Refer to documentation of az.convert_to_dataset for details group : str, optional ... | 3.027842 | 3 |
cuestionario/formularios.py | LisandroCanteros/Grupo2_COM06_Info2021 | 0 | 8961 | from django.forms import ModelForm
from .models import Cuestionario, Categoria
from preguntas.models import Pregunta, Respuesta
class CuestionarioForm(ModelForm):
class Meta:
model = Cuestionario
fields = '__all__'
class PreguntaForm(ModelForm):
class Meta:
model = Pregunta
fi... | from django.forms import ModelForm
from .models import Cuestionario, Categoria
from preguntas.models import Pregunta, Respuesta
class CuestionarioForm(ModelForm):
class Meta:
model = Cuestionario
fields = '__all__'
class PreguntaForm(ModelForm):
class Meta:
model = Pregunta
fi... | none | 1 | 2.267855 | 2 | |
vitcloud/views.py | biocross/VITCloud | 2 | 8962 | <filename>vitcloud/views.py
from django.views.generic import View
from django.http import HttpResponse
import os, json, datetime
from django.shortcuts import redirect
from django.shortcuts import render_to_response
from vitcloud.models import File
from django.views.decorators.csrf import csrf_exempt
from listingapikeys... | <filename>vitcloud/views.py
from django.views.generic import View
from django.http import HttpResponse
import os, json, datetime
from django.shortcuts import redirect
from django.shortcuts import render_to_response
from vitcloud.models import File
from django.views.decorators.csrf import csrf_exempt
from listingapikeys... | en | 0.60277 | # sys.setdefaultencoding is cancelled by site.py # to re-enable sys.setdefaultencoding() #Custom Functions: #**Not for Production** Views #Views: | 1.88197 | 2 |
blurple/ui/base.py | jeremytiki/blurple.py | 4 | 8963 | <reponame>jeremytiki/blurple.py
from abc import ABC
import discord
class Base(discord.Embed, ABC):
async def send(self, client: discord.abc.Messageable):
""" Send the component as a message in discord.
:param client: The client used, usually a :class:`discord.abc.Messageable`. Must have implemen... | from abc import ABC
import discord
class Base(discord.Embed, ABC):
async def send(self, client: discord.abc.Messageable):
""" Send the component as a message in discord.
:param client: The client used, usually a :class:`discord.abc.Messageable`. Must have implemented :func:`.send`
:retur... | en | 0.572518 | Send the component as a message in discord. :param client: The client used, usually a :class:`discord.abc.Messageable`. Must have implemented :func:`.send` :returns: :class:`discord.Message` | 3.066206 | 3 |
migrations/versions/e86dd3bc539c_change_admin_to_boolean.py | jonzxz/project-piscator | 0 | 8964 | """change admin to boolean
Revision ID: e86dd3bc539c
Revises: <KEY>
Create Date: 2020-11-11 22:32:00.707936
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e86dd3bc539c'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | """change admin to boolean
Revision ID: e86dd3bc539c
Revises: <KEY>
Create Date: 2020-11-11 22:32:00.707936
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e86dd3bc539c'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | en | 0.52941 | change admin to boolean Revision ID: e86dd3bc539c Revises: <KEY> Create Date: 2020-11-11 22:32:00.707936 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic ... | 1.528658 | 2 |
school/migrations/0010_alter_sala_unique_together.py | adrianomqsmts/django-escola | 0 | 8965 | <reponame>adrianomqsmts/django-escola
# Generated by Django 4.0.3 on 2022-03-16 03:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('school', '0009_rename_periodo_semestre_alter_semestre_options_and_more'),
]
operations = [
migrations.AlterUni... | # Generated by Django 4.0.3 on 2022-03-16 03:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('school', '0009_rename_periodo_semestre_alter_semestre_options_and_more'),
]
operations = [
migrations.AlterUniqueTogether(
name='sala',
... | en | 0.786966 | # Generated by Django 4.0.3 on 2022-03-16 03:09 | 1.548085 | 2 |
code_trunk/trainer/abc.py | chris4540/DD2430-ds-proj | 0 | 8966 | """
Abstract training class
"""
from abc import ABC as AbstractBaseClass
from abc import abstractmethod
class AdstractTrainer(AbstractBaseClass):
@abstractmethod
def run(self):
pass
@abstractmethod
def prepare_data_loaders(self):
"""
For preparing data loaders and save them a... | """
Abstract training class
"""
from abc import ABC as AbstractBaseClass
from abc import abstractmethod
class AdstractTrainer(AbstractBaseClass):
@abstractmethod
def run(self):
pass
@abstractmethod
def prepare_data_loaders(self):
"""
For preparing data loaders and save them a... | en | 0.841932 | Abstract training class For preparing data loaders and save them as instance attributes Define stuff which are before the actual run. For example: - Optimizer - Model | 3.231257 | 3 |
quadpy/triangle/cools_haegemans.py | melvyniandrag/quadpy | 1 | 8967 | <reponame>melvyniandrag/quadpy
# -*- coding: utf-8 -*-
#
from mpmath import mp
from .helpers import untangle2
class CoolsHaegemans(object):
"""
<NAME>, <NAME>,
Construction of minimal cubature formulae for the square and the triangle
using invariant theory,
Department of Computer Science, K.U.Leu... | # -*- coding: utf-8 -*-
#
from mpmath import mp
from .helpers import untangle2
class CoolsHaegemans(object):
"""
<NAME>, <NAME>,
Construction of minimal cubature formulae for the square and the triangle
using invariant theory,
Department of Computer Science, K.U.Leuven,
TW Reports vol:TW96, S... | en | 0.512785 | # -*- coding: utf-8 -*- # <NAME>, <NAME>, Construction of minimal cubature formulae for the square and the triangle using invariant theory, Department of Computer Science, K.U.Leuven, TW Reports vol:TW96, Sept. 1987, <https://lirias.kuleuven.be/handle/123456789/131869>. # elif index == 2: # self... | 2.69609 | 3 |
account/admin.py | RichardLeeH/invoce_sys | 0 | 8968 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from account.models import Profile
admin.site.site_header = 'invoc... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from account.models import Profile
admin.site.site_header = 'invoce'
class T... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.918512 | 2 |
oops/#016exceptions.py | krishankansal/PythonPrograms | 0 | 8969 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 08:40:11 2020
@author: krishan
"""
def funny_division2(anumber):
try:
if anumber == 13:
raise ValueError("13 is an unlucky number")
return 100 / anumber
except (ZeroDivisionError, TypeError):
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 08:40:11 2020
@author: krishan
"""
def funny_division2(anumber):
try:
if anumber == 13:
raise ValueError("13 is an unlucky number")
return 100 / anumber
except (ZeroDivisionError, TypeError):
return "E... | en | 0.555924 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Thu Jun 18 08:40:11 2020 @author: krishan #raise | 3.892881 | 4 |
config/simclr_config.py | denn-s/SimCLR | 5 | 8970 | <filename>config/simclr_config.py
import os
from datetime import datetime
import torch
from dataclasses import dataclass
class SimCLRConfig:
@dataclass()
class Base:
output_dir_path: str
log_dir_path: str
log_file_path: str
device: object
num_gpu: int
logger_na... | <filename>config/simclr_config.py
import os
from datetime import datetime
import torch
from dataclasses import dataclass
class SimCLRConfig:
@dataclass()
class Base:
output_dir_path: str
log_dir_path: str
log_file_path: str
device: object
num_gpu: int
logger_na... | en | 0.843267 | # batch_size as usual. examples: 16,32,.. # number of workers to be used for data loading. examples: 2,4,... # start training with this epoch. most likely: 0 # in case of restart this is where the saved model is expected to be located # end training with this epoch. examples: 10, 100,... # directory where the datasets ... | 2.546368 | 3 |
test/unit/common/middleware/s3api/test_obj.py | Priyanka-Askani/swift | 1 | 8971 | # Copyright (c) 2014 OpenStack Foundation
#
# 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 agreed to ... | # Copyright (c) 2014 OpenStack Foundation
#
# 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 agreed to ... | en | 0.800796 | # Copyright (c) 2014 OpenStack Foundation # # 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 agreed to ... | 1.58916 | 2 |
pynyzo/pynyzo/keyutil.py | EggPool/pynyzo | 6 | 8972 | """
Eddsa Ed25519 key handling
From
https://github.com/n-y-z-o/nyzoVerifier/blob/b73bc25ba3094abe3470ec070ce306885ad9a18f/src/main/java/co/nyzo/verifier/KeyUtil.java
plus
https://github.com/n-y-z-o/nyzoVerifier/blob/17509f03a7f530c0431ce85377db9b35688c078e/src/main/java/co/nyzo/verifier/util/SignatureUtil.java
"""
# ... | """
Eddsa Ed25519 key handling
From
https://github.com/n-y-z-o/nyzoVerifier/blob/b73bc25ba3094abe3470ec070ce306885ad9a18f/src/main/java/co/nyzo/verifier/KeyUtil.java
plus
https://github.com/n-y-z-o/nyzoVerifier/blob/17509f03a7f530c0431ce85377db9b35688c078e/src/main/java/co/nyzo/verifier/util/SignatureUtil.java
"""
# ... | en | 0.529476 | Eddsa Ed25519 key handling From https://github.com/n-y-z-o/nyzoVerifier/blob/b73bc25ba3094abe3470ec070ce306885ad9a18f/src/main/java/co/nyzo/verifier/KeyUtil.java plus https://github.com/n-y-z-o/nyzoVerifier/blob/17509f03a7f530c0431ce85377db9b35688c078e/src/main/java/co/nyzo/verifier/util/SignatureUtil.java # Uses http... | 2.763858 | 3 |
mldftdat/scripts/train_gp.py | mir-group/CiderPress | 10 | 8973 | from argparse import ArgumentParser
import os
import numpy as np
from joblib import dump
from mldftdat.workflow_utils import SAVE_ROOT
from mldftdat.models.gp import *
from mldftdat.data import load_descriptors, filter_descriptors
import yaml
def parse_settings(args):
fname = args.datasets_list[0]
if args.suff... | from argparse import ArgumentParser
import os
import numpy as np
from joblib import dump
from mldftdat.workflow_utils import SAVE_ROOT
from mldftdat.models.gp import *
from mldftdat.data import load_descriptors, filter_descriptors
import yaml
def parse_settings(args):
fname = args.datasets_list[0]
if args.suff... | en | 0.179827 | # offset in case repeat datasets are used #parser.add_argument('-m', '--model-class', type=str, default=None) #parser.add_argument('-k', '--kernel', help='kernel initialization strategy', type=str, default=None) #if args.heg: # gpr.add_heg_limit() # Always attach the arguments to the object to keep track of settings... | 2.205937 | 2 |
picoCTF-web/api/routes/admin.py | zaratec/picoCTF | 0 | 8974 | <filename>picoCTF-web/api/routes/admin.py
import api
import bson
from api.annotations import (
api_wrapper,
log_action,
require_admin,
require_login,
require_teacher
)
from api.common import WebError, WebSuccess
from flask import (
Blueprint,
Flask,
render_template,
request,
send... | <filename>picoCTF-web/api/routes/admin.py
import api
import bson
from api.annotations import (
api_wrapper,
log_action,
require_admin,
require_login,
require_teacher
)
from api.common import WebError, WebSuccess
from flask import (
Blueprint,
Flask,
render_template,
request,
send... | none | 1 | 2.296451 | 2 | |
python code/influxdb_worker.py | thongnbui/MIDS_251_project | 0 | 8975 | <reponame>thongnbui/MIDS_251_project
#!/usr/bin/python
import json
import argparse
from influxdb import InfluxDBClient
parser = argparse.ArgumentParser(description = 'pull data for softlayer queue' )
parser.add_argument( 'measurement' , help = 'measurement001' )
args = parser.parse_args()
client_influxdb = InfluxDB... | #!/usr/bin/python
import json
import argparse
from influxdb import InfluxDBClient
parser = argparse.ArgumentParser(description = 'pull data for softlayer queue' )
parser.add_argument( 'measurement' , help = 'measurement001' )
args = parser.parse_args()
client_influxdb = InfluxDBClient('172.16.31.10', '8086', 'crick... | ru | 0.258958 | #!/usr/bin/python | 2.587181 | 3 |
src/python/pants/backend/docker/lint/hadolint/subsystem.py | xyzst/pants | 0 | 8976 | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from typing import cast
from pants.core.util_rules.config_files import ConfigFilesRequest
from pants.core.util_rules.external_tool import TemplatedExte... | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from typing import cast
from pants.core.util_rules.config_files import ConfigFilesRequest
from pants.core.util_rules.external_tool import TemplatedExte... | en | 0.726419 | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). # TODO: https://github.com/hadolint/hadolint/issues/411 tracks building and releasing # hadolint for Linux ARM64. # same as mac x86 #configure).\n\n" # Refer to https://github.com/hadolint... | 1.930714 | 2 |
venv/lib/python3.9/site-packages/biorun/fetch.py | LucaCilibrasi/docker_viruclust | 0 | 8977 | <filename>venv/lib/python3.9/site-packages/biorun/fetch.py
"""
Handles functionality related to data storege.
"""
import sys, os, glob, re, gzip, json
from biorun import const, utils, objects, ncbi
from biorun.models import jsonrec
import biorun.libs.placlib as plac
# Module level logger.
logger = utils.logger
# A ni... | <filename>venv/lib/python3.9/site-packages/biorun/fetch.py
"""
Handles functionality related to data storege.
"""
import sys, os, glob, re, gzip, json
from biorun import const, utils, objects, ncbi
from biorun.models import jsonrec
import biorun.libs.placlib as plac
# Module level logger.
logger = utils.logger
# A ni... | en | 0.748943 | Handles functionality related to data storege. # Module level logger. # A nicer error message on incorrect installation. Resolve a file name given an accession number. Deletes data under a filename. Returns the content of a JSON file. Returns the content of a JSON file. Changes the sequence id stored in a json file. Ob... | 2.265965 | 2 |
game/items/game_item.py | LaverdeS/Genetic_Algorithm_EGame | 2 | 8978 | <filename>game/items/game_item.py<gh_stars>1-10
import numpy as np
from random import randint
from PyQt5.QtGui import QImage
from PyQt5.QtCore import QPointF
class GameItem():
def __init__(self, parent, boundary, position=None):
self.parent = parent
self.config = parent.config
self.items_... | <filename>game/items/game_item.py<gh_stars>1-10
import numpy as np
from random import randint
from PyQt5.QtGui import QImage
from PyQt5.QtCore import QPointF
class GameItem():
def __init__(self, parent, boundary, position=None):
self.parent = parent
self.config = parent.config
self.items_... | none | 1 | 2.797971 | 3 | |
source/deepsecurity/models/application_type_rights.py | felipecosta09/cloudone-workload-controltower-lifecycle | 1 | 8979 | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | en | 0.681668 | # coding: utf-8 Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate Deep Security ... | 1.521312 | 2 |
code-samples/aws_neptune.py | hardikvasa/database-journal | 45 | 8980 | from __future__ import print_function # Python 2/3 compatibility
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverR... | from __future__ import print_function # Python 2/3 compatibility
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverR... | en | 0.812514 | # Python 2/3 compatibility #initializing the graph object #creating connection with the remote #clearing out all the vertices to start fresh #Adding some vertices (nodes) #Adding relationships (edges) #print out all the node's first names #print out all the properties of person whose's first name is Shane #traversing t... | 2.381719 | 2 |
kits19cnn/io/preprocess_train.py | Ramsha04/kits19-2d-reproduce | 0 | 8981 | <reponame>Ramsha04/kits19-2d-reproduce
import os
from os.path import join, isdir
from pathlib import Path
from collections import defaultdict
from tqdm import tqdm
import nibabel as nib
import numpy as np
import json
from .resample import resample_patient
from .custom_augmentations import resize_data_and_seg, crop_to_... | import os
from os.path import join, isdir
from pathlib import Path
from collections import defaultdict
from tqdm import tqdm
import nibabel as nib
import numpy as np
import json
from .resample import resample_patient
from .custom_augmentations import resize_data_and_seg, crop_to_bbox
class Preprocessor(object):
"... | en | 0.734419 | Preprocesses the original dataset (interpolated). Procedures: * Resampled all volumes to have a thickness of 3mm. * Clipped to [-30, 300] HU * z-score standardization (zero mean and unit variance) * Standardization per 3D image instead of ACROSS THE WHOLE TRAINING SET... | 2.217607 | 2 |
setup.py | opywan/calm-dsl | 0 | 8982 | <reponame>opywan/calm-dsl
import sys
import setuptools
from setuptools.command.test import test as TestCommand
def read_file(filename):
with open(filename, "r", encoding='utf8') as f:
return f.read()
class PyTest(TestCommand):
"""PyTest"""
def finalize_options(self):
"""finalize_options... | import sys
import setuptools
from setuptools.command.test import test as TestCommand
def read_file(filename):
with open(filename, "r", encoding='utf8') as f:
return f.read()
class PyTest(TestCommand):
"""PyTest"""
def finalize_options(self):
"""finalize_options"""
TestCommand.fi... | en | 0.665701 | PyTest finalize_options run_tests | 1.913758 | 2 |
hanlp/pretrained/tok.py | chen88358323/HanLP | 2 | 8983 | <reponame>chen88358323/HanLP
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 21:12
from hanlp_common.constant import HANLP_URL
SIGHAN2005_PKU_CONVSEG = HANLP_URL + 'tok/sighan2005-pku-convseg_20200110_153722.zip'
'Conv model (:cite:`wang-xu-2017-convolutional`) trained on sighan2005 pku dataset.'
SIGHAN2005... | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 21:12
from hanlp_common.constant import HANLP_URL
SIGHAN2005_PKU_CONVSEG = HANLP_URL + 'tok/sighan2005-pku-convseg_20200110_153722.zip'
'Conv model (:cite:`wang-xu-2017-convolutional`) trained on sighan2005 pku dataset.'
SIGHAN2005_MSR_CONVSEG = HANLP_URL + 't... | en | 0.876793 | # -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-28 21:12 # Will be filled up during runtime | 1.330566 | 1 |
third_party/webrtc/src/chromium/src/tools/swarming_client/tests/logging_utils_test.py | bopopescu/webrtc-streaming-node | 8 | 8984 | #!/usr/bin/env python
# Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
import logging
import os
import subprocess
import sys
import tempfile
import shutil
import unittest
import re
THIS_FILE... | #!/usr/bin/env python
# Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
import logging
import os
import subprocess
import sys
import tempfile
import shutil
import unittest
import re
THIS_FILE... | en | 0.891518 | #!/usr/bin/env python # Copyright 2015 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. # PID YYYY-MM-DD HH:MM:SS.MMM Calls itself back. # It'd be nice to figure out a way to ensure it's properly in UTC but it... | 2.257668 | 2 |
model_selection.py | HrishikV/ineuron_inceome_prediction_internship | 0 | 8985 | from featur_selection import df,race,occupation,workclass,country
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import cross_val_score,KFold
from sklearn.linear_model import LogisticRegression
from imblearn.pipeline import Pipeline
from sklearn.compose import ColumnT... | from featur_selection import df,race,occupation,workclass,country
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import cross_val_score,KFold
from sklearn.linear_model import LogisticRegression
from imblearn.pipeline import Pipeline
from sklearn.compose import ColumnT... | none | 1 | 2.798963 | 3 | |
tests/apps/newlayout/tasks/init_data.py | blazelibs/blazeweb | 0 | 8986 | <gh_stars>0
from __future__ import print_function
def action_010():
print('doit')
| from __future__ import print_function
def action_010():
print('doit') | none | 1 | 1.339277 | 1 | |
2021/d8b_bits.py | apie/advent-of-code | 4 | 8987 | <reponame>apie/advent-of-code<gh_stars>1-10
#!/usr/bin/env python3
import pytest
import fileinput
from os.path import splitext, abspath
F_NAME = 'd8'
#implement day8 using bits
def find_ones(d):
'''count number of ones in binary number'''
ones = 0
while d > 0:
ones += d & 1
d >>= 1
retu... | #!/usr/bin/env python3
import pytest
import fileinput
from os.path import splitext, abspath
F_NAME = 'd8'
#implement day8 using bits
def find_ones(d):
'''count number of ones in binary number'''
ones = 0
while d > 0:
ones += d & 1
d >>= 1
return ones
# Assign each segment a 'wire'.
lut... | en | 0.789035 | #!/usr/bin/env python3 #implement day8 using bits count number of ones in binary number # Assign each segment a 'wire'. Look up each output val in binary repr in the mapping and add them together shifting each digit to the left. # Convert letter string to binary pattern ## Search for each digit and if found, remove it ... | 3.340067 | 3 |
frame_dataloader/spatial_dataloader.py | rizkiailham/two-stream-action-recognition-1 | 67 | 8988 | """
********************************
* Created by mohammed-alaa *
********************************
Spatial Dataloader implementing sequence api from keras (defines how to load a single item)
this loads batches of images for each iteration it returns [batch_size, height, width ,3] ndarrays
"""
import copy
import ran... | """
********************************
* Created by mohammed-alaa *
********************************
Spatial Dataloader implementing sequence api from keras (defines how to load a single item)
this loads batches of images for each iteration it returns [batch_size, height, width ,3] ndarrays
"""
import copy
import ran... | en | 0.676978 | ******************************** * Created by mohammed-alaa * ******************************** Spatial Dataloader implementing sequence api from keras (defines how to load a single item) this loads batches of images for each iteration it returns [batch_size, height, width ,3] ndarrays get data structure to load dat... | 2.945303 | 3 |
dianhua/worker/crawler/china_mobile/hunan/base_request_param.py | Svolcano/python_exercise | 6 | 8989 | <gh_stars>1-10
# -*- coding:utf-8 -*-
"""
@version: v1.0
@author: xuelong.liu
@license: Apache Licence
@contact: <EMAIL>
@software: PyCharm
@file: base_request_param.py
@time: 12/21/16 6:48 PM
"""
class RequestParam(object):
"""
请求相关
"""
# URL
START_URL = "https://www.hn.10086.cn/service/static... | # -*- coding:utf-8 -*-
"""
@version: v1.0
@author: xuelong.liu
@license: Apache Licence
@contact: <EMAIL>
@software: PyCharm
@file: base_request_param.py
@time: 12/21/16 6:48 PM
"""
class RequestParam(object):
"""
请求相关
"""
# URL
START_URL = "https://www.hn.10086.cn/service/static/componant/logi... | en | 0.264811 | # -*- coding:utf-8 -*- @version: v1.0 @author: xuelong.liu @license: Apache Licence @contact: <EMAIL> @software: PyCharm @file: base_request_param.py @time: 12/21/16 6:48 PM 请求相关 # URL # GET_CAPTCHA_URL = "http://www.hn.10086.cn/service/ics/servlet/ImageServlet" # GET_CAPTCHA_URL = "http://www.hn.10086.cn/newservice/i... | 2.217799 | 2 |
day02/puzzle2.py | jack-beach/AdventOfCode2019 | 0 | 8990 | <reponame>jack-beach/AdventOfCode2019
# stdlib imports
import copy
# vendor imports
import click
@click.command()
@click.argument("input_file", type=click.File("r"))
def main(input_file):
"""Put your puzzle execution code here"""
# Convert the comma-delimited string of numbers into a list of ints
masterR... | # stdlib imports
import copy
# vendor imports
import click
@click.command()
@click.argument("input_file", type=click.File("r"))
def main(input_file):
"""Put your puzzle execution code here"""
# Convert the comma-delimited string of numbers into a list of ints
masterRegister = list(
map(lambda op:... | en | 0.850623 | # stdlib imports # vendor imports Put your puzzle execution code here # Convert the comma-delimited string of numbers into a list of ints # Create a local copy of the register for this execution # Inject the noun and verb # We will start reading the opcodes at position 0 # Loop infinitely until we reach the termination... | 3.682303 | 4 |
ionosenterprise/items/backupunit.py | ionos-cloud/ionos-enterprise-sdk-python | 6 | 8991 | <filename>ionosenterprise/items/backupunit.py
class BackupUnit(object):
def __init__(self, name, password=<PASSWORD>, email=None):
"""
BackupUnit class initializer.
:param name: A name of that resource (only alphanumeric characters are acceptable)"
:type name: ``str``
... | <filename>ionosenterprise/items/backupunit.py
class BackupUnit(object):
def __init__(self, name, password=<PASSWORD>, email=None):
"""
BackupUnit class initializer.
:param name: A name of that resource (only alphanumeric characters are acceptable)"
:type name: ``str``
... | en | 0.861247 | BackupUnit class initializer. :param name: A name of that resource (only alphanumeric characters are acceptable)" :type name: ``str`` :param password: The password associated to that resource. :type password: ``str`` :param email: The email associate... | 2.959529 | 3 |
install.py | X-lab-3D/PANDORA | 0 | 8992 | import os
dirs = [
'./PANDORA_files', './PANDORA_files/data', './PANDORA_files/data/csv_pkl_files',
'./PANDORA_files/data/csv_pkl_files/mhcseqs', './PANDORA_files/data/PDBs',
'./PANDORA_files/data/PDBs/pMHCI', './PANDORA_files/data/PDBs/pMHCII',
'./PANDORA_files/data/PDBs/Bad', './PANDO... | import os
dirs = [
'./PANDORA_files', './PANDORA_files/data', './PANDORA_files/data/csv_pkl_files',
'./PANDORA_files/data/csv_pkl_files/mhcseqs', './PANDORA_files/data/PDBs',
'./PANDORA_files/data/PDBs/pMHCI', './PANDORA_files/data/PDBs/pMHCII',
'./PANDORA_files/data/PDBs/Bad', './PANDO... | en | 0.205351 | # Install dependenciess # os.popen("alias KEY_MODELLER='XXXX'").read() # os.popen("conda install -y -c salilab modeller").read() # os.popen("conda install -y -c bioconda muscle").read() # os.popen("pip install -e ./").read() | 2.241816 | 2 |
app/auth/views.py | MainaKamau92/apexselftaught | 4 | 8993 | <gh_stars>1-10
# app/auth/views.py
import os
from flask import flash, redirect, render_template, url_for, request
from flask_login import login_required, login_user, logout_user, current_user
from . import auth
from .forms import (LoginForm, RegistrationForm,
RequestResetForm, ResetPasswordForm)
fro... | # app/auth/views.py
import os
from flask import flash, redirect, render_template, url_for, request
from flask_login import login_required, login_user, logout_user, current_user
from . import auth
from .forms import (LoginForm, RegistrationForm,
RequestResetForm, ResetPasswordForm)
from .. import db,... | en | 0.802745 | # app/auth/views.py Handle requests to the /register route Add an user to the database through the registration form # add user to the database # redirect to the login page # load registration form Handle requests to the /login route Log an employee in through the login form # redirect to the freelancer dashboa... | 2.626333 | 3 |
oslo_messaging/_drivers/zmq_driver/client/publishers/zmq_dealer_publisher.py | devendermishrajio/oslo.messaging | 1 | 8994 | <filename>oslo_messaging/_drivers/zmq_driver/client/publishers/zmq_dealer_publisher.py
# Copyright 2015 Mirantis, Inc.
#
# 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
#
# ... | <filename>oslo_messaging/_drivers/zmq_driver/client/publishers/zmq_dealer_publisher.py
# Copyright 2015 Mirantis, Inc.
#
# 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
#
# ... | en | 0.909297 | # Copyright 2015 Mirantis, Inc. # # 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 ... | 1.902001 | 2 |
coba/environments/filters.py | mrucker/banditbenchmark | 0 | 8995 | import pickle
import warnings
import collections.abc
from math import isnan
from statistics import mean, median, stdev, mode
from abc import abstractmethod, ABC
from numbers import Number
from collections import defaultdict
from itertools import islice, chain
from typing import Hashable, Optional, Sequence, Union, Ite... | import pickle
import warnings
import collections.abc
from math import isnan
from statistics import mean, median, stdev, mode
from abc import abstractmethod, ABC
from numbers import Number
from collections import defaultdict
from itertools import islice, chain
from typing import Hashable, Optional, Sequence, Union, Ite... | en | 0.831988 | A filter that can be applied to an Environment. Apply a filter to an Environment's interactions. Return whatever interactions are given to the filter. Take a fixed number of interactions from an Environment. Shuffle a sequence of Interactions in an Environment. Take a fixed number of random Interactions from an Environ... | 2.495381 | 2 |
python/cuml/preprocessing/LabelEncoder.py | egoolish/cuml | 7 | 8996 | <gh_stars>1-10
#
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... | #
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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 agreed ... | en | 0.636093 | # # Copyright (c) 2019, NVIDIA CORPORATION. # # 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 agreed ... | 3.116228 | 3 |
cleaning.py | jhamrick/cogsci-proceedings-analysis | 0 | 8997 | <filename>cleaning.py
import re
import difflib
import pandas as pd
import numpy as np
from nameparser import HumanName
from nameparser.config import CONSTANTS
CONSTANTS.titles.remove("gen")
CONSTANTS.titles.remove("prin")
def parse_paper_type(section_name):
section_name = section_name.strip().lower()
if sect... | <filename>cleaning.py
import re
import difflib
import pandas as pd
import numpy as np
from nameparser import HumanName
from nameparser.config import CONSTANTS
CONSTANTS.titles.remove("gen")
CONSTANTS.titles.remove("prin")
def parse_paper_type(section_name):
section_name = section_name.strip().lower()
if sect... | en | 0.864058 | # get rid of commas where there are suffixes, like Jr. or III # special cases | 2.891892 | 3 |
quem_foi_para_mar_core/migrations/0004_auto_20200811_1945.py | CamilaBodack/template-projeto-selecao | 1 | 8998 | <filename>quem_foi_para_mar_core/migrations/0004_auto_20200811_1945.py
# Generated by Django 3.1 on 2020-08-11 19:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('quem_foi_para_mar_core', '0003_auto_20200811_1944'),
]
operations = [
migration... | <filename>quem_foi_para_mar_core/migrations/0004_auto_20200811_1945.py
# Generated by Django 3.1 on 2020-08-11 19:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('quem_foi_para_mar_core', '0003_auto_20200811_1944'),
]
operations = [
migration... | en | 0.811966 | # Generated by Django 3.1 on 2020-08-11 19:45 | 1.563202 | 2 |
examples/tinytag/fuzz.py | MJ-SEO/py_fuzz | 0 | 8999 | from pythonfuzz.main import PythonFuzz
from tinytag import TinyTag
import io
@PythonFuzz
def fuzz(buf):
try:
f = open('temp.mp4', "wb")
f.write(buf)
f.seek(0)
tag = TinyTag.get(f.name)
except UnicodeDecodeError:
pass
if __name__ == '__main__':
fuzz()
| from pythonfuzz.main import PythonFuzz
from tinytag import TinyTag
import io
@PythonFuzz
def fuzz(buf):
try:
f = open('temp.mp4', "wb")
f.write(buf)
f.seek(0)
tag = TinyTag.get(f.name)
except UnicodeDecodeError:
pass
if __name__ == '__main__':
fuzz()
| none | 1 | 2.224836 | 2 |