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 |
|---|---|---|---|---|---|---|---|---|---|---|
stats/types.py | TravelChain/golos-ql | 5 | 6621251 | <filename>stats/types.py
import graphene
from graphene.relay import Node
from graphene_mongo import MongoengineObjectType
from post.models import CommentModel
from stats.models import DGPModel
class GDB(MongoengineObjectType):
class Meta:
description = 'dynamic_global_properties'
model = DGPModel... | <filename>stats/types.py
import graphene
from graphene.relay import Node
from graphene_mongo import MongoengineObjectType
from post.models import CommentModel
from stats.models import DGPModel
class GDB(MongoengineObjectType):
class Meta:
description = 'dynamic_global_properties'
model = DGPModel... | none | 1 | 2.335878 | 2 | |
warp_transducer/pytorch_binding/warprnnt_pytorch/__init__.py | qq1418381215/caat | 14 | 6621252 | <reponame>qq1418381215/caat<gh_stars>10-100
import torch
from torch.autograd import Function
from torch.nn import Module
from .warp_rnnt import *
from .rnnt import rnnt_loss,RNNTLoss
from .delay_transducer import delay_transducer_loss, DelayTLoss
__all__ = ['rnnt_loss', 'RNNTLoss','delay_transducer_loss', 'DelayTLos... | import torch
from torch.autograd import Function
from torch.nn import Module
from .warp_rnnt import *
from .rnnt import rnnt_loss,RNNTLoss
from .delay_transducer import delay_transducer_loss, DelayTLoss
__all__ = ['rnnt_loss', 'RNNTLoss','delay_transducer_loss', 'DelayTLoss'] | none | 1 | 1.805727 | 2 | |
data_wrangling/createcsv.py | puntofisso/EUTwinnings | 0 | 6621253 | <reponame>puntofisso/EUTwinnings
import urllib.request, json
import time
import csv
from scipy import spatial
from numpy import dot
from numpy.linalg import norm
import pandas as pd
import numpy as np
from sklearn import preprocessing
# creates csv from globaldictionary and list of nuts
def createCSV():
csv... | import urllib.request, json
import time
import csv
from scipy import spatial
from numpy import dot
from numpy.linalg import norm
import pandas as pd
import numpy as np
from sklearn import preprocessing
# creates csv from globaldictionary and list of nuts
def createCSV():
csvfile = open("basicdata.tsv", "w")... | en | 0.565689 | # creates csv from globaldictionary and list of nuts # RS|REPUBLIKA SRBIJA /РЕПУБЛИКА СРБИЈА|0|RS|NUTS1|NUTS2|NUTS3 # get dictionaries for this area and its ancestors # data about this nuts # data about containing nuts - no container nuts #thisline = f'{code}|{level}|"{name}"|{nuts0}|{nuts1}|{nuts2}|{pop3}|{pop2}|{pop1... | 2.892831 | 3 |
brownbags/management/commands/load_csv.py | openkawasaki/brownbag-django | 2 | 6621254 | <reponame>openkawasaki/brownbag-django
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import environ
#import config.settings.local as settings
import traceback
import logging
logger = logging.getLogger('init')
import pandas as pd
import numpy as np
import math
import copy
#------... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import environ
#import config.settings.local as settings
import traceback
import logging
logger = logging.getLogger('init')
import pandas as pd
import numpy as np
import math
import copy
#-------------------------------------------
d... | ja | 0.158192 | #!/usr/bin/env python # -*- coding: utf-8 -*- #import config.settings.local as settings #------------------------------------------- #------------------------------------------- #------------------------------------------- # TestCase #------------------------------------------- # https://django-testing-docs.readthedocs... | 2.222958 | 2 |
nipo/tests/populate.py | Ahmad4z/nipo | 0 | 6621255 | #This file will eventually be removed. It is here to test functionality that interfaces with objects that havent been created or functionality that requires a populated DB (for this we use nipo_test which is a mirror of nipo but whose contents are used for testing purposes)
#Documentation for creating an instance of t... | #This file will eventually be removed. It is here to test functionality that interfaces with objects that havent been created or functionality that requires a populated DB (for this we use nipo_test which is a mirror of nipo but whose contents are used for testing purposes)
#Documentation for creating an instance of t... | en | 0.82654 | #This file will eventually be removed. It is here to test functionality that interfaces with objects that havent been created or functionality that requires a populated DB (for this we use nipo_test which is a mirror of nipo but whose contents are used for testing purposes) #Documentation for creating an instance of th... | 2.463476 | 2 |
HOUDINI/Library/Utils/NNUtils.py | CTPLab/AutoCI | 5 | 6621256 | <gh_stars>1-10
import json
import torch
import torch.nn as nn
from typing import Dict, Tuple, List
from HOUDINI.Library.NN import NetMLP, NetDO, NetCNN
def get_nn_from_params_dict(uf: Dict) -> Tuple[nn.Module, List]:
"""Instantiate the unkown function (uf) required
by the high-order functions with a neural ... | import json
import torch
import torch.nn as nn
from typing import Dict, Tuple, List
from HOUDINI.Library.NN import NetMLP, NetDO, NetCNN
def get_nn_from_params_dict(uf: Dict) -> Tuple[nn.Module, List]:
"""Instantiate the unkown function (uf) required
by the high-order functions with a neural network
Ar... | en | 0.714178 | Instantiate the unkown function (uf) required by the high-order functions with a neural network Args: uf: the dict of unknown function storing the parameters for the nn candidate Instantiate an unkown function (uf) required by the high-order functions with a trained neural network ... | 2.473825 | 2 |
catkin_ws/src/machine_learning/src/fotos.py | EnzoBassano/Software | 0 | 6621257 | #!/usr/bin/env python
import rospy #importar ros para python
from sensor_msgs.msg import Image
import cv2 as cv
from cv_bridge import CvBridge
from std_msgs.msg import String, Int32 # importar mensajes de ROS tipo String y tipo Int32
from geometry_msgs.msg import Twist # importar mensajes de ROS tipo geometry / Twist
... | #!/usr/bin/env python
import rospy #importar ros para python
from sensor_msgs.msg import Image
import cv2 as cv
from cv_bridge import CvBridge
from std_msgs.msg import String, Int32 # importar mensajes de ROS tipo String y tipo Int32
from geometry_msgs.msg import Twist # importar mensajes de ROS tipo geometry / Twist
... | es | 0.7933 | #!/usr/bin/env python #importar ros para python # importar mensajes de ROS tipo String y tipo Int32 # importar mensajes de ROS tipo geometry / Twist #def publicar(self): #def callback(self,msg): #creacion y registro del nodo! # Crea un objeto del tipo Template, cuya definicion se encuentra arriba #objeto.publicar() #ll... | 2.657505 | 3 |
curso_hector/17-funcionalidades-avanzadas/funcion_map.py | corahama/python | 1 | 6621258 | <gh_stars>1-10
a = [1,2,3,4,5]
b = [6,7,8,9,10]
c = [11,12,13,14,15]
# print(list(map(lambda x,y,z: x*y*z, a,b,c)))
class Persona:
def __init__(self, nombre, edad):
self.nombre = nombre
self.edad = edad
def __str__(self):
return "{} de {} años.".format(self.nombre, self.edad)
person... | a = [1,2,3,4,5]
b = [6,7,8,9,10]
c = [11,12,13,14,15]
# print(list(map(lambda x,y,z: x*y*z, a,b,c)))
class Persona:
def __init__(self, nombre, edad):
self.nombre = nombre
self.edad = edad
def __str__(self):
return "{} de {} años.".format(self.nombre, self.edad)
personas = (
Pers... | en | 0.07262 | # print(list(map(lambda x,y,z: x*y*z, a,b,c))) | 3.601932 | 4 |
1046.py | OmangRawat/Leetcode | 0 | 6621259 | <gh_stars>0
"""
---> Last Stone Weight
---> Easy
"""
import bisect
import heapq
class Solution:
def lastStoneWeight(self, stones) -> int:
heap = [-x for x in stones]
heapq.heapify(heap)
while len(heap) > 1 and heap[0] != 0:
heapq.heappush(heap, heapq.heappop(heap) - heapq.hea... | """
---> Last Stone Weight
---> Easy
"""
import bisect
import heapq
class Solution:
def lastStoneWeight(self, stones) -> int:
heap = [-x for x in stones]
heapq.heapify(heap)
while len(heap) > 1 and heap[0] != 0:
heapq.heappush(heap, heapq.heappop(heap) - heapq.heappop(heap))
... | en | 0.762184 | ---> Last Stone Weight ---> Easy Approach 1: Make a min heap of negative o weights i.e. somehow same max heap, get the 2 top elements check for diff and append it back if their is something remaining till len smaller than 1 and heap[0] != 0 Approach 2: Use bisect.insort after sorting the array, take top 2 elements su... | 3.431826 | 3 |
spconv/pytorch/tables.py | xmyqsh/spconv | 0 | 6621260 | <filename>spconv/pytorch/tables.py<gh_stars>0
# Copyright 2021 <NAME>
#
# 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... | <filename>spconv/pytorch/tables.py<gh_stars>0
# Copyright 2021 <NAME>
#
# 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... | en | 0.80548 | # Copyright 2021 <NAME> # # 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, softw... | 2.179085 | 2 |
python/testData/refactoring/introduceVariable/backslash.after.py | jnthn/intellij-community | 2 | 6621261 | def f(x):
a = x.foo.bar
return a.baz() | def f(x):
a = x.foo.bar
return a.baz() | none | 1 | 1.673176 | 2 | |
9_functions/10_documentingFunctions.py | qaidjohar/PythonCourse | 0 | 6621262 | <reponame>qaidjohar/PythonCourse
def exponent(num, power = 2):
"""This is the exponent documentation\n\nUsage: exponent(number, power)\nExample: exponent(5,2)."""
return num ** power
print(exponent.__doc__)
exponent() | def exponent(num, power = 2):
"""This is the exponent documentation\n\nUsage: exponent(number, power)\nExample: exponent(5,2)."""
return num ** power
print(exponent.__doc__)
exponent() | en | 0.303624 | This is the exponent documentation\n\nUsage: exponent(number, power)\nExample: exponent(5,2). | 3.738832 | 4 |
python/Latin Numerals To English.py | TechieHelper/Codewars | 0 | 6621263 | <filename>python/Latin Numerals To English.py
# A program to turn Latin numerals into English Characters
data = "VI"
total = 0
def string_flip(flipData):
dataLength = len(flipData)
dataFlip = flipData[dataLength::-1]
flipData = dataFlip
return flipData
data = string_flip(data)
data = list(data)
f... | <filename>python/Latin Numerals To English.py
# A program to turn Latin numerals into English Characters
data = "VI"
total = 0
def string_flip(flipData):
dataLength = len(flipData)
dataFlip = flipData[dataLength::-1]
flipData = dataFlip
return flipData
data = string_flip(data)
data = list(data)
f... | en | 0.688635 | # A program to turn Latin numerals into English Characters # LOOP INSIDE 99!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 3.574398 | 4 |
newssimilarity/segment_sim/tf_idf.py | imackerracher/NewsSimilarity | 0 | 6621264 | from newssimilarity.segment_sim.segment_similarity_measurement import SegmentSimMeasurement
from nltk.corpus import stopwords
from scipy import spatial
import math
import nltk
class TfIdf(SegmentSimMeasurement):
def __init__(self, token_dict, segment_list, source_segment, target_segment):
"""
:par... | from newssimilarity.segment_sim.segment_similarity_measurement import SegmentSimMeasurement
from nltk.corpus import stopwords
from scipy import spatial
import math
import nltk
class TfIdf(SegmentSimMeasurement):
def __init__(self, token_dict, segment_list, source_segment, target_segment):
"""
:par... | en | 0.789175 | :param token_dict: all the tokens in the corpus as a dictionary with the frequencies :param segment_list: list of dictionaries containing all segments :param source_segment: The 2 segments that are being compared :param target_segment: Calculate the frequencies of all tokens apart from stop word... | 3.200418 | 3 |
doAllGraphs.py | zerosquadron/grove-weather-pi | 1 | 6621265 | <gh_stars>1-10
#
# calculate all graphs
#
# SwitchDoc Labs March 30, 2015
import sys
sys.path.append('/home/pi/SDL_Pi_GroveWeatherPi/graphs')
# Check for user imports
try:
import conflocal as config
except ImportError:
import config
import TemperatureHumidityGraph
import PowerCurrentGraph
import P... | #
# calculate all graphs
#
# SwitchDoc Labs March 30, 2015
import sys
sys.path.append('/home/pi/SDL_Pi_GroveWeatherPi/graphs')
# Check for user imports
try:
import conflocal as config
except ImportError:
import config
import TemperatureHumidityGraph
import PowerCurrentGraph
import PowerVoltageGrap... | en | 0.818805 | # # calculate all graphs # # SwitchDoc Labs March 30, 2015 # Check for user imports | 1.901204 | 2 |
qcloudsdkcvm/DeleteKeyPairRequest.py | f3n9/qcloudcli | 0 | 6621266 | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DeleteKeyPairRequest(Request):
def __init__(self):
super(DeleteKeyPairRequest, self).__init__(
'cvm', 'qcloudcliV1', 'DeleteKeyPair', 'cvm.api.qcloud.com')
def get_keyIds(self):
return self.get_params().get('... | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DeleteKeyPairRequest(Request):
def __init__(self):
super(DeleteKeyPairRequest, self).__init__(
'cvm', 'qcloudcliV1', 'DeleteKeyPair', 'cvm.api.qcloud.com')
def get_keyIds(self):
return self.get_params().get('... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.985665 | 2 |
photos/views.py | careymwarabu/Gallery | 0 | 6621267 | <reponame>careymwarabu/Gallery<filename>photos/views.py
from django.shortcuts import render
from django.http import HttpResponse
from .models import Image, ImageCategory, ImageLocation
from django.core.exceptions import ObjectDoesNotExist
# Create your views here.
def index(request):
images = Image.objects.all()
... | from django.shortcuts import render
from django.http import HttpResponse
from .models import Image, ImageCategory, ImageLocation
from django.core.exceptions import ObjectDoesNotExist
# Create your views here.
def index(request):
images = Image.objects.all()
categories = ImageCategory.objects.all()
locatio... | en | 0.968116 | # Create your views here. | 2.370521 | 2 |
identipy/peptide_centric.py | comcon1/identipy | 0 | 6621268 | <reponame>comcon1/identipy
import numpy as np
from string import punctuation
from collections import defaultdict
import operator as op
from bisect import bisect
from pyteomics import parser, mass, fasta, auxiliary as aux, mgf, mzml
from . import scoring, utils
import logging
logger = logging.getLogger(__name__)
try:
... | import numpy as np
from string import punctuation
from collections import defaultdict
import operator as op
from bisect import bisect
from pyteomics import parser, mass, fasta, auxiliary as aux, mgf, mzml
from . import scoring, utils
import logging
logger = logging.getLogger(__name__)
try:
from pyteomics import cm... | en | 0.294962 | # logger.warning('cmass could not be imported') # import pyximport; pyximport.install() # m = cmass.fast_mass(seqm, aa_mass=kwargs['aa_mass']) + (nterm_mass - 1.007825) + (cterm_mass - 17.002735) # st = utils.get_title(s) #settings.getfloat('search', 'product accuracy ppm')) # FIXME (?) # st = utils.get_title(s) #se... | 2.028716 | 2 |
workers/custodian.py | UphillD/edgebench | 3 | 6621269 | <reponame>UphillD/edgebench<gh_stars>1-10
# Edgebench Platform
# Worker Scripts
# Custodian Module
#
# Starts, monitors and maintains a combination of applications
#
# Data Structures:
# Pandas DataFrames:
# task_matrix: [ 'z', 'w', 'D', 'Start Timestamp', 'Predicted Duration' ]
# Types: [ int, int, int... | # Edgebench Platform
# Worker Scripts
# Custodian Module
#
# Starts, monitors and maintains a combination of applications
#
# Data Structures:
# Pandas DataFrames:
# task_matrix: [ 'z', 'w', 'D', 'Start Timestamp', 'Predicted Duration' ]
# Types: [ int, int, int, flt, flt ]
# Stores information ... | en | 0.688526 | # Edgebench Platform # Worker Scripts # Custodian Module # # Starts, monitors and maintains a combination of applications # # Data Structures: # Pandas DataFrames: # task_matrix: [ 'z', 'w', 'D', 'Start Timestamp', 'Predicted Duration' ] # Types: [ int, int, int, flt, flt ] # Stores information ... | 2.319859 | 2 |
rxnebm/proposer/gln_openretro/test.py | coleygroup/rxn-ebm | 5 | 6621270 | <gh_stars>1-10
import argparse
import logging
import os
import sys
from datetime import datetime
from gln.common.cmd_args import cmd_args as gln_args
from models.gln_model.gln_tester import GLNTester
try:
from models.transformer_model.transformer_tester import TransformerTester
from onmt.bin.translate import _g... | import argparse
import logging
import os
import sys
from datetime import datetime
from gln.common.cmd_args import cmd_args as gln_args
from models.gln_model.gln_tester import GLNTester
try:
from models.transformer_model.transformer_tester import TransformerTester
from onmt.bin.translate import _get_parser
excep... | en | 0.544068 | Simplified interface for testing only. For actual usage downstream use the respective proposer class # Overwrite default gln_args with runtime args # adapted from onmt.bin.translate.main() # update runtime args # logger setup # test interface | 2.334249 | 2 |
bin/python/metrices_animation.py | liran121211/NeuralNetwork-From-Scratch-Java | 0 | 6621271 | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
import random
import pandas as pd
def animate(i, data_1, data_2, line1_fig, line2_fig):
temp1 = data_1.iloc[:int(i+1)]
temp2 = data_2.iloc[:int(i+1)]
line1_fig.set_data(temp1.index, temp1['values']) # (values) column
... | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
import random
import pandas as pd
def animate(i, data_1, data_2, line1_fig, line2_fig):
temp1 = data_1.iloc[:int(i+1)]
temp2 = data_2.iloc[:int(i+1)]
line1_fig.set_data(temp1.index, temp1['values']) # (values) column
... | en | 0.399169 | # (values) column # (values) column # init fig # Main Title # Bottom Title # Y Label # set min-max range of x-axis # set min-max range of y-axis # create datasets | 3.379778 | 3 |
src/opencmiss/importer/base.py | OpenCMISS-Bindings/opencmiss.importer | 0 | 6621272 | import os.path
def valid(inputs, description):
if type(inputs) == list:
if type(inputs) != type(description):
return False
if len(inputs) != len(description):
return False
for index, input_ in enumerate(inputs):
if "mimetype" in description[index]:
... | import os.path
def valid(inputs, description):
if type(inputs) == list:
if type(inputs) != type(description):
return False
if len(inputs) != len(description):
return False
for index, input_ in enumerate(inputs):
if "mimetype" in description[index]:
... | none | 1 | 2.80774 | 3 | |
tests/__init__.py | kueda/underfoot | 4 | 6621273 | <gh_stars>1-10
# Does this need to be a module?
| # Does this need to be a module? | en | 0.871671 | # Does this need to be a module? | 1.072006 | 1 |
partlist.py | insomniacslk/partlist | 0 | 6621274 | <filename>partlist.py
#!/usr/bin/env python
# Author: <NAME> <<EMAIL>>
# License: 3-clause BSD
# This simple script fetches a partition list and saves it as JSON and as a C
# function.
# Usage: ./partitions.py
#
import re
import json
import urllib
import collections
partitions_url = 'http://www.win.tue.nl/~aeb/par... | <filename>partlist.py
#!/usr/bin/env python
# Author: <NAME> <<EMAIL>>
# License: 3-clause BSD
# This simple script fetches a partition list and saves it as JSON and as a C
# function.
# Usage: ./partitions.py
#
import re
import json
import urllib
import collections
partitions_url = 'http://www.win.tue.nl/~aeb/par... | en | 0.752641 | #!/usr/bin/env python # Author: <NAME> <<EMAIL>> # License: 3-clause BSD # This simple script fetches a partition list and saves it as JSON and as a C # function. # Usage: ./partitions.py # | 2.735548 | 3 |
app/external_systems/identification_system.py | tamayonauta/contact-directory | 0 | 6621275 | from .data import PERSONAL_DATA
class IdentificationSystem:
@classmethod
def get_personal_data(cls, data):
personal_data = cls._get_personal_data(data)
return personal_data
@classmethod
def _get_personal_data(cls, data):
if not len(data) or "id_number" not in data:
... | from .data import PERSONAL_DATA
class IdentificationSystem:
@classmethod
def get_personal_data(cls, data):
personal_data = cls._get_personal_data(data)
return personal_data
@classmethod
def _get_personal_data(cls, data):
if not len(data) or "id_number" not in data:
... | none | 1 | 3.011604 | 3 | |
tuxtvicons.py | i026e/Python-playlist-editor | 0 | 6621276 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 09:56:31 2016
@author: pavel
"""
import os
from sys import argv
import mconfig as conf
OUTPUT_FILE = "add.txt" #/usr/share/freetuxtv/tv_channels.xml
pattern = """
<tvchannel name="{channel_name}">
<logo_filename>{logo_name}</logo_filename>
</t... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 09:56:31 2016
@author: pavel
"""
import os
from sys import argv
import mconfig as conf
OUTPUT_FILE = "add.txt" #/usr/share/freetuxtv/tv_channels.xml
pattern = """
<tvchannel name="{channel_name}">
<logo_filename>{logo_name}</logo_filename>
</t... | en | 0.53707 | #!/usr/bin/python3 # -*- coding: utf-8 -*- Created on Wed Apr 27 09:56:31 2016 @author: pavel #/usr/share/freetuxtv/tv_channels.xml <tvchannel name="{channel_name}"> <logo_filename>{logo_name}</logo_filename> </tvchannel> # execute only if run as a script | 2.873078 | 3 |
hello.py | feat7/machine-learning-hello-world | 0 | 6621277 | # Load libraries
import pandas
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import L... | # Load libraries
import pandas
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import L... | en | 0.421561 | # Load libraries # Load dataset # Docs for pandas.read_csv # url -> csv file = buffer/file path # names -> list of columns to be used (set their names) # retruns -> DataFrame or TextParser # shape # print(dataset.shape) # returns -> tuple representing the dimension of the DataFrame # head # print(dataset.head(20)) # re... | 3.131496 | 3 |
py/model.py | Enigmatisms/NeRF | 1 | 6621278 | <gh_stars>1-10
#-*-coding:utf-8-*-
"""
NeRF network details. To be finished ...
"""
import torch
from torch import nn
from torch.nn import functional as F
from apex import amp
from py.nerf_helper import makeMLP, positional_encoding
# import tinycudann as tcnn
# This module is shared by coarse and fine network, w... | #-*-coding:utf-8-*-
"""
NeRF network details. To be finished ...
"""
import torch
from torch import nn
from torch.nn import functional as F
from apex import amp
from py.nerf_helper import makeMLP, positional_encoding
# import tinycudann as tcnn
# This module is shared by coarse and fine network, with no need to ... | en | 0.843133 | #-*-coding:utf-8-*- NeRF network details. To be finished ... # import tinycudann as tcnn # This module is shared by coarse and fine network, with no need to modify # MLP before skip connection # authors said that ReLU is used here # for coarse network, input is obtained by sampling, sampling result is (ray_num, point_n... | 2.12963 | 2 |
tests/core/test_serializer_list.py | hugosenari/dbus_curio | 0 | 6621279 | <filename>tests/core/test_serializer_list.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for `dbus_curio.core.serializer.serialize_list` function.
"""
import sys
import unittest
from dbus_curio.core.serializer import serialize_list
class TestSerializerList(unittest.TestCase):
def test_000_... | <filename>tests/core/test_serializer_list.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for `dbus_curio.core.serializer.serialize_list` function.
"""
import sys
import unittest
from dbus_curio.core.serializer import serialize_list
class TestSerializerList(unittest.TestCase):
def test_000_... | en | 0.282827 | #!/usr/bin/env python # -*- coding: utf-8 -*- Tests for `dbus_curio.core.serializer.serialize_list` function. | 2.7798 | 3 |
lib/Flask-ACL/flask_acl/globals.py | mikeboers/Spoon | 4 | 6621280 | <reponame>mikeboers/Spoon<gh_stars>1-10
import functools
import werkzeug as wz
from flask import current_app
# Proxy to the current app's AuthManager
current_auth = wz.local.LocalProxy(lambda: current_app.auth_manager)
| import functools
import werkzeug as wz
from flask import current_app
# Proxy to the current app's AuthManager
current_auth = wz.local.LocalProxy(lambda: current_app.auth_manager) | en | 0.882306 | # Proxy to the current app's AuthManager | 1.752477 | 2 |
python/ray/rllib/RL/envs/target_tracking/belief_tracker.py | christopher-hsu/ray | 1 | 6621281 | """Belief Trackers
KFbelief : Belief Update using Kalman Filter
UKFbelief : Belief Update using Unscented Kalman Filter using filterpy library
"""
import numpy as np
import envs.env_utils as util
from numpy import linalg as LA
import pdb
from filterpy.kalman import JulierSigmaPoints, UnscentedKalmanFilter, ExtendedK... | """Belief Trackers
KFbelief : Belief Update using Kalman Filter
UKFbelief : Belief Update using Unscented Kalman Filter using filterpy library
"""
import numpy as np
import envs.env_utils as util
from numpy import linalg as LA
import pdb
from filterpy.kalman import JulierSigmaPoints, UnscentedKalmanFilter, ExtendedK... | en | 0.467715 | Belief Trackers KFbelief : Belief Update using Kalman Filter UKFbelief : Belief Update using Unscented Kalman Filter using filterpy library Kalman Filter for the target tracking problem. state : target state x : agent state z : observation (r, alpha) dim : dimension of state limit : An array of tw... | 2.862833 | 3 |
services/traction/acapy_wrapper/models/v20_cred_ex_record_detail.py | Open-Earth-Foundation/traction | 12 | 6621282 | <gh_stars>10-100
# coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
from acapy_wrapper.models.v20_cred_ex_reco... | # coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
from acapy_wrapper.models.v20_cred_ex_record import V20Cred... | en | 0.650944 | # coding: utf-8 # noqa: F401 # noqa: F401 # noqa: F401 # noqa: F401 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. V20CredExRecordDetail - a model defined in OpenAPI cred_ex_record: The cred_ex_record of this V20CredExRecordDe... | 1.963244 | 2 |
source/ch08/magic-numbers.py | AngelLiang/programming-in-python3-2nd-edition | 0 | 6621283 | <reponame>AngelLiang/programming-in-python3-2nd-edition<gh_stars>0
#!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Fo... | #!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | en | 0.835666 | #!/usr/bin/env python3 # Copyright (c) 2008-11 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) an... | 2.63039 | 3 |
src/accounts/serializers.py | Bounty1993/rest-crm | 0 | 6621284 | <filename>src/accounts/serializers.py
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from rest_framework import serializers
from rest_framework.serializers import (
ModelSerializer, Serializer,
ValidationError, HyperlinkedModelSerializer,
)
f... | <filename>src/accounts/serializers.py
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from rest_framework import serializers
from rest_framework.serializers import (
ModelSerializer, Serializer,
ValidationError, HyperlinkedModelSerializer,
)
f... | none | 1 | 2.358344 | 2 | |
processing/preprocessing.py | LiamWahahaha/how-creative-you-are | 0 | 6621285 | <reponame>LiamWahahaha/how-creative-you-are
import time
from modules.spark_processor import SparkProcessor
from modules.utils import Print
def main():
tic = time.perf_counter()
Print.info('Start preprocessing')
parallel_processor = SparkProcessor()
spark = parallel_processor.spark
Print.info('Load... | import time
from modules.spark_processor import SparkProcessor
from modules.utils import Print
def main():
tic = time.perf_counter()
Print.info('Start preprocessing')
parallel_processor = SparkProcessor()
spark = parallel_processor.spark
Print.info('Load metadata file from s3')
metadata_s3_pat... | none | 1 | 2.634349 | 3 | |
ttastromech/ttastromech_pyaudio.py | MomsFriendlyRobotCompany/ttr2d2 | 5 | 6621286 | from ttastromech import TTAstromech
try:
import pyaudio
class TTAstromechPyAudio(TTAstromech):
def __init__(self, path="/sounds"):
TTAstromech.__init__(self, path)
def _play(self, data):
p = pyaudio.PyAudio()
stream = p.open(
format=p.get_format_from_width(2),
channels=1,
rate=22050,
o... | from ttastromech import TTAstromech
try:
import pyaudio
class TTAstromechPyAudio(TTAstromech):
def __init__(self, path="/sounds"):
TTAstromech.__init__(self, path)
def _play(self, data):
p = pyaudio.PyAudio()
stream = p.open(
format=p.get_format_from_width(2),
channels=1,
rate=22050,
o... | none | 1 | 2.793695 | 3 | |
DropMenu.py | StormInside/DropDownMenu | 1 | 6621287 | from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtWidgets import QApplication, \
QMainWindow, \
QVBoxLayout, \
QSizeGrip
from auto_generated_UI import UI_main
class DropMenu(QMainWindow, UI_main.Ui_MainWindow):
def __init__(sel... | from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtWidgets import QApplication, \
QMainWindow, \
QVBoxLayout, \
QSizeGrip
from auto_generated_UI import UI_main
class DropMenu(QMainWindow, UI_main.Ui_MainWindow):
def __init__(sel... | en | 0.139706 | # print(self.hasFocus()) | 2.354929 | 2 |
abides-gym/abides_gym/envs/markets_execution_environment_v0.py | jpmorganchase/ABIDES-jpmc-gym | 1 | 6621288 | <reponame>jpmorganchase/ABIDES-jpmc-gym<filename>abides-gym/abides_gym/envs/markets_execution_environment_v0.py
import importlib
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, List
from abc import ABC
import gym
import numpy as np
import abides_markets.agents.utils as markets_agent_uti... | import importlib
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, List
from abc import ABC
import gym
import numpy as np
import abides_markets.agents.utils as markets_agent_utils
from abides_core import NanosecondTime
from abides_core.utils import str_to_ns
from abides_core.generators im... | en | 0.783212 | Execution V0 environnement. It defines one of the ABIDES-Gym-markets environnement. This environment presents an example of the algorithmic orderexecution problem. The agent has either an initial inventory of the stocks it tries to trade out of or no initial inventory and tries to acquire a target number of... | 2.742692 | 3 |
Raspberry-Pi/src/solarduino.py | PHPirates/SolArduino | 3 | 6621289 | import socket
import subprocess
import sys
import cherrypy
import psutil
from cherrypy.process.plugins import Daemonizer, PIDFile
from src.webserver.webserver import Webserver
pid_path = '/tmp/solarduino.pid'
def get_ip() -> str:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80... | import socket
import subprocess
import sys
import cherrypy
import psutil
from cherrypy.process.plugins import Daemonizer, PIDFile
from src.webserver.webserver import Webserver
pid_path = '/tmp/solarduino.pid'
def get_ip() -> str:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80... | en | 0.699726 | Kill current process if it is running. Start SolArduino. # Don't daemonize when Pycharm is debugging | 2.075211 | 2 |
corehq/apps/ota/migrations/0011_remove_devicelogrequest_deviceid.py | dimagilg/commcare-hq | 471 | 6621290 | <filename>corehq/apps/ota/migrations/0011_remove_devicelogrequest_deviceid.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-03-11 19:26
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ota', '0010_alter_dev... | <filename>corehq/apps/ota/migrations/0011_remove_devicelogrequest_deviceid.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-03-11 19:26
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ota', '0010_alter_dev... | en | 0.689485 | # -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-03-11 19:26 | 1.547446 | 2 |
api/views.py | YSP-SINERGY/xserver-sinergy2021-event-website | 0 | 6621291 | from db import Db
from flask import request
from flask_restful import Resource
from sqlalchemy import text as sql_text
class YouthVote(Resource): # YouthページでAPIリクエスト時のロジックを制御するクラス
""" The votes View """
def __init__(self):
self.db = Db()
def get(self):
""" Returns a list of votes """
... | from db import Db
from flask import request
from flask_restful import Resource
from sqlalchemy import text as sql_text
class YouthVote(Resource): # YouthページでAPIリクエスト時のロジックを制御するクラス
""" The votes View """
def __init__(self):
self.db = Db()
def get(self):
""" Returns a list of votes """
... | en | 0.50366 | # YouthページでAPIリクエスト時のロジックを制御するクラス The votes View Returns a list of votes # query = "SELECT * FROM youth_vote ORDER BY id ASC" Add a vote to the db Expect a JSON payload with the following format { "vote_counts": "The number of votes gained" } # TeensページでAPIリクエスト時のロジックを制御するクラス The vo... | 3.21424 | 3 |
mundo 3/091.py | thiagofreitascarneiro/Curso-de-Python---Curso-em-Video | 1 | 6621292 | from random import randint
from time import sleep
from operator import itemgetter
jogador = {}
cont = 0
print('Valores Sorteados:')
for i in range(1, 5):
jogador[i] = randint(1, 6)
for j, d in jogador.items():
sleep(1)
print(f'O Jogador{j} tirou {d}')
print('Ranking dos jogadores:')
print(jogador)
#Serve pa... | from random import randint
from time import sleep
from operator import itemgetter
jogador = {}
cont = 0
print('Valores Sorteados:')
for i in range(1, 5):
jogador[i] = randint(1, 6)
for j, d in jogador.items():
sleep(1)
print(f'O Jogador{j} tirou {d}')
print('Ranking dos jogadores:')
print(jogador)
#Serve pa... | pt | 0.739125 | #Serve para ordenar um dicionario do maior para o menor | 3.623769 | 4 |
examples/traductor/tests/test_translators.py | connectthefuture/docker-hacks | 5 | 6621293 | <filename>examples/traductor/tests/test_translators.py
import six
import unittest
from traductor.translators import (cap_add, cap_drop, container_name, cpu_shares, cpuset, devices,
dns, dns_search, entrypoint, env_file, environment, expose, hostname, labels, links,
log_driver, mac_address, mem_limit, memswap_li... | <filename>examples/traductor/tests/test_translators.py
import six
import unittest
from traductor.translators import (cap_add, cap_drop, container_name, cpu_shares, cpuset, devices,
dns, dns_search, entrypoint, env_file, environment, expose, hostname, labels, links,
log_driver, mac_address, mem_limit, memswap_li... | none | 1 | 2.799461 | 3 | |
main.py | Stylix58/flame | 3 | 6621294 | <reponame>Stylix58/flame<gh_stars>1-10
#!/usr/bin/env python3
import fire
import subprocess
import ini
import os.path
from os import remove as removefile
__composer_not_installed__ = "Composer can't start because he is not installed! Install it at https://getcomposer.org/doc/00-intro.md#globally!"
__install_loc_not_se... | #!/usr/bin/env python3
import fire
import subprocess
import ini
import os.path
from os import remove as removefile
__composer_not_installed__ = "Composer can't start because he is not installed! Install it at https://getcomposer.org/doc/00-intro.md#globally!"
__install_loc_not_set__ = "Flarum installation location is ... | en | 0.59554 | #!/usr/bin/env python3 #globally!" Flame V1\n A extension installer for Flarum. Installs a extension. Uninstalls a extension. Changes the configuration for the location of Flarum installation. | 2.384089 | 2 |
arxiv/canonical/register/exceptions.py | arXiv/arxiv-canonical | 5 | 6621295 | class ConsistencyError(Exception):
"""Operation was attempted that would violate consistency of the record."""
class NoSuchResource(Exception):
"""Operation was attempted on a non-existant resource.""" | class ConsistencyError(Exception):
"""Operation was attempted that would violate consistency of the record."""
class NoSuchResource(Exception):
"""Operation was attempted on a non-existant resource.""" | en | 0.9937 | Operation was attempted that would violate consistency of the record. Operation was attempted on a non-existant resource. | 2.244683 | 2 |
theory/13th_sprint/F.py | abi83/YaPractice | 3 | 6621296 | <reponame>abi83/YaPractice
"""
Нужно реализовать класс StackMax, который поддерживает операцию определения
максимума среди всех элементов в стеке. Класс должен поддерживать операции
push, pop и get_max.
"""
class StackMax:
def __init__(self):
self.data = []
def __str__(self):
return str(self.... | """
Нужно реализовать класс StackMax, который поддерживает операцию определения
максимума среди всех элементов в стеке. Класс должен поддерживать операции
push, pop и get_max.
"""
class StackMax:
def __init__(self):
self.data = []
def __str__(self):
return str(self.data)
def push(self, x... | ru | 0.99632 | Нужно реализовать класс StackMax, который поддерживает операцию определения максимума среди всех элементов в стеке. Класс должен поддерживать операции push, pop и get_max. | 3.839402 | 4 |
improver_tests/wxcode/wxcode/__init__.py | bmatilla/improver | 0 | 6621297 | <filename>improver_tests/wxcode/wxcode/__init__.py
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are... | <filename>improver_tests/wxcode/wxcode/__init__.py
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are... | en | 0.71536 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a... | 1.337289 | 1 |
tests/test_gaussian.py | JZK00/MONAI | 3 | 6621298 | # Copyright 2020 MONAI Consortium
# 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, s... | # Copyright 2020 MONAI Consortium
# 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, s... | en | 0.846037 | # Copyright 2020 MONAI Consortium # 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, s... | 1.923691 | 2 |
anaadementia/assin/assin_sts.py | lbsantos/ANAA-Dementia | 0 | 6621299 | <filename>anaadementia/assin/assin_sts.py
# -*- coding: utf-8 -*-
from anaadementia.preprocessing.text_preprocessing import PreprocessingSTS, ExpadingSynonyms
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.utils.validation import check_is_... | <filename>anaadementia/assin/assin_sts.py
# -*- coding: utf-8 -*-
from anaadementia.preprocessing.text_preprocessing import PreprocessingSTS, ExpadingSynonyms
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.utils.validation import check_is_... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.093765 | 2 |
decodesamsungbin.py | nlitsme/CelbEprDecode | 3 | 6621300 | """
Tool for decoding the Cellebrite UFED bootloaders from ufedsamsungpack_v21.epr
It will write the decoded binary in a filename with suffix '.decoded'
Author: <NAME> <<EMAIL>>
"""
from __future__ import division, print_function
import struct
def processcelbdata(data):
vectors = struct.unpack("<3L4s4LL4sLL", da... | """
Tool for decoding the Cellebrite UFED bootloaders from ufedsamsungpack_v21.epr
It will write the decoded binary in a filename with suffix '.decoded'
Author: <NAME> <<EMAIL>>
"""
from __future__ import division, print_function
import struct
def processcelbdata(data):
vectors = struct.unpack("<3L4s4LL4sLL", da... | en | 0.658287 | Tool for decoding the Cellebrite UFED bootloaders from ufedsamsungpack_v21.epr It will write the decoded binary in a filename with suffix '.decoded' Author: <NAME> <<EMAIL>> | 2.841823 | 3 |
src/mk_inc.py | stanzabird/gil | 0 | 6621301 | #!/usr/bin/python3
# read input data file
with open('mk_inc.txt') as f:
content = f.readlines()
content = [x.strip() for x in content]
# check input file, build input data structure
data = []
typeno = 0
for line in content:
if not line or line[0] == '#':
continue
fields = line.split(':')
# cas... | #!/usr/bin/python3
# read input data file
with open('mk_inc.txt') as f:
content = f.readlines()
content = [x.strip() for x in content]
# check input file, build input data structure
data = []
typeno = 0
for line in content:
if not line or line[0] == '#':
continue
fields = line.split(':')
# cas... | en | 0.557753 | #!/usr/bin/python3 # read input data file # check input file, build input data structure # cast the fields to the right data type # simple tesing of data consistency #{fields[1]} (should be {typeno}') # generate monster type for monster.h This is a long multiline f-string where I can put souce code blocks into. the nu... | 2.959438 | 3 |
fullprocess.py | jmcabreira/Dynamic-risk-assessment-system | 1 | 6621302 |
import training
import scoring
import deployment
import diagnostics
import reporting
import ast
import json
import os
import glob
import sys
import subprocess
from scoring import score_model
##################Load config file and paths
with open('config.json','r') as f:
config = json.load(f)
input_folder_path... |
import training
import scoring
import deployment
import diagnostics
import reporting
import ast
import json
import os
import glob
import sys
import subprocess
from scoring import score_model
##################Load config file and paths
with open('config.json','r') as f:
config = json.load(f)
input_folder_path... | en | 0.673291 | ##################Load config file and paths ##################Check and read new data #first, read ingestedfiles.txt # print(ingested_files) #second, determine whether the source data folder has files that aren't listed in ingestedfiles.txt ##################Deciding whether to proceed, part 1 #if you found new data, ... | 2.171342 | 2 |
src/mpass/mpass/migrations/0002_auto_20180329_1246.py | haltu/velmu-mpass-demo | 0 | 6621303 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-29 09:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import parler.models
class Migration(migrations.Migration):
dependencies = [
('mpass', '0001_initial'),
]
o... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-29 09:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import parler.models
class Migration(migrations.Migration):
dependencies = [
('mpass', '0001_initial'),
]
o... | en | 0.677603 | # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-29 09:46 | 1.656102 | 2 |
ansible/utils/gcp/gcp.py | hyperledger-labs-archives/fabric-vms-provision | 1 | 6621304 | <reponame>hyperledger-labs-archives/fabric-vms-provision
'''generate gce role'''
import argparse
GCE_TEMPLATE_INTRO = '''---
- name: create multiple instances
gce:
instance_names: "{{ item.name }}"
tags: "{{ item.tag }}"
zone: "{{ zone }}"
machine_type: "{{ machine_type }}"
image: "{{ image }}"
... | '''generate gce role'''
import argparse
GCE_TEMPLATE_INTRO = '''---
- name: create multiple instances
gce:
instance_names: "{{ item.name }}"
tags: "{{ item.tag }}"
zone: "{{ zone }}"
machine_type: "{{ machine_type }}"
image: "{{ image }}"
state: present
service_account_email: "{{ service... | en | 0.598413 | generate gce role --- - name: create multiple instances gce: instance_names: "{{ item.name }}" tags: "{{ item.tag }}" zone: "{{ zone }}" machine_type: "{{ machine_type }}" image: "{{ image }}" state: present service_account_email: "{{ service_account_email }}" credentials_file: "{{ cre... | 2.352201 | 2 |
onnx_pytorch/op_code_generators/Split.py | BernardJiang/onnx-pytorch | 66 | 6621305 | <gh_stars>10-100
import onnx
import torch
from onnx.numpy_helper import to_array
from onnx_pytorch.op_code_generators import OpCodeGenerator
class SplitOpCodeGenerator(OpCodeGenerator):
def __init__(self,
onnx_ver=onnx.defs.onnx_opset_version(),
torch_ver=torch.__version__):
supe... | import onnx
import torch
from onnx.numpy_helper import to_array
from onnx_pytorch.op_code_generators import OpCodeGenerator
class SplitOpCodeGenerator(OpCodeGenerator):
def __init__(self,
onnx_ver=onnx.defs.onnx_opset_version(),
torch_ver=torch.__version__):
super(SplitOpCodeGene... | none | 1 | 2.415128 | 2 | |
VMEncryption/test/test_ResourceDiskUtil.py | jamvar/azure-linux-extensions | 1 | 6621306 | #!/usr/bin/env python
#
# *********************************************************
# Copyright (c) Microsoft. All rights reserved.
#
# Apache 2.0 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, software
# dis... | #!/usr/bin/env python
#
# *********************************************************
# Copyright (c) Microsoft. All rights reserved.
#
# Apache 2.0 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, software
# dis... | en | 0.694595 | #!/usr/bin/env python # # ********************************************************* # Copyright (c) Microsoft. All rights reserved. # # Apache 2.0 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, software # dis... | 2.241122 | 2 |
pokemon/models.py | juanmarcoscabezas/poke-api | 0 | 6621307 | from django.db import models
class Pokemon(models.Model):
name = models.CharField(max_length=200)
height = models.CharField(max_length=50)
weight = models.CharField(max_length=50)
image = models.CharField(max_length=1024, default='')
# Stats
hp = models.IntegerField()
attack = models.Intege... | from django.db import models
class Pokemon(models.Model):
name = models.CharField(max_length=200)
height = models.CharField(max_length=50)
weight = models.CharField(max_length=50)
image = models.CharField(max_length=1024, default='')
# Stats
hp = models.IntegerField()
attack = models.Intege... | ca | 0.362216 | # Stats # Parent | 2.08826 | 2 |
part-B.py | FAWC-bupt/Covid19Spider | 11 | 6621308 | <gh_stars>10-100
"""
累计确诊数排名前 20 的国家名称及其数量(利用12月15日数据)
"""
import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei'] # 用来正常显示中文标签
plt.rcParams['savefig.dpi'] = 300 # 图片像素
plt.rcParams['figure.dpi'] = 300 # 分辨率
plt.style.use('Solarize_Light2')
df = pd.read_csv('csvFi... | """
累计确诊数排名前 20 的国家名称及其数量(利用12月15日数据)
"""
import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei'] # 用来正常显示中文标签
plt.rcParams['savefig.dpi'] = 300 # 图片像素
plt.rcParams['figure.dpi'] = 300 # 分辨率
plt.style.use('Solarize_Light2')
df = pd.read_csv('csvFile/Covid19Data202... | zh | 0.906502 | 累计确诊数排名前 20 的国家名称及其数量(利用12月15日数据) # 用来正常显示中文标签 # 图片像素 # 分辨率 # print(df.describe()) # print(df.info()) # ascending=True为升序,反之为降序 # 在直方图上显示数字 | 3.005809 | 3 |
picatrix/lib/manager.py | google/picatrix | 27 | 6621309 | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.757334 | # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.338015 | 2 |
src/runtastic_strava_migration_tool.py | hudcondr/Digital-preservation---sports-trackers-for-Strava | 0 | 6621310 | <reponame>hudcondr/Digital-preservation---sports-trackers-for-Strava
#!/usr/bin/env python
import os
import json
from stravalib import Client, exc
from requests.exceptions import ConnectionError
import csv
import shutil
import time
from datetime import datetime, timedelta
import sys
import pandas as pd
import random
a... | #!/usr/bin/env python
import os
import json
from stravalib import Client, exc
from requests.exceptions import ConnectionError
import csv
import shutil
import time
from datetime import datetime, timedelta
import sys
import pandas as pd
import random
access_token = sys.argv[1]
def convert_json_to_csv(filepath):
fo... | en | 0.855815 | #!/usr/bin/env python # designates part of day for name assignment, matching Strava convention for GPS activities # Get a small range of time. Note runkeeper does not maintain timezone # in the CSV, so we must get about 12 hours earlier and later to account # for potential miss due to UTC # convert to total time in sec... | 2.888184 | 3 |
Python/project_euler_6.py | PushpneetSingh/Hello-world | 1,428 | 6621311 | <reponame>PushpneetSingh/Hello-world<filename>Python/project_euler_6.py<gh_stars>1000+
# https://projecteuler.net/
# Problem 6
# Sum square difference
def check(s):
for i in range(0, int(len(s)/2)):
if s[i] != s[(len(s)-1)-i]:
return False
return True
def palindrome():
large = 9009
... | # https://projecteuler.net/
# Problem 6
# Sum square difference
def check(s):
for i in range(0, int(len(s)/2)):
if s[i] != s[(len(s)-1)-i]:
return False
return True
def palindrome():
large = 9009
smallest =
for i in range(999, 99, -1):
for j in range(999, 99, -1):
... | en | 0.205661 | # https://projecteuler.net/ # Problem 6 # Sum square difference | 3.305184 | 3 |
beerializer/__init__.py | iamale/beerializer | 2 | 6621312 | <reponame>iamale/beerializer
from . import fields
from . import base
from . import validators
from .base import ValidationError, InvalidTypeValidationError, Serializer
__version__ = "1.0.0"
__all__ = [
"fields", "base", "validators", "ValidationError",
"InvalidTypeValidationError", "Serializer"
]
| from . import fields
from . import base
from . import validators
from .base import ValidationError, InvalidTypeValidationError, Serializer
__version__ = "1.0.0"
__all__ = [
"fields", "base", "validators", "ValidationError",
"InvalidTypeValidationError", "Serializer"
] | none | 1 | 1.740345 | 2 | |
read_arduino/receive_serial_data_from_arduino.py | samuelchiang/auto_tank | 5 | 6621313 | #!/usr/bin/env python3
import serial
import datetime
import time
import logging
if __name__ == '__main__':
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
ser.flush()
logging.basicConfig(filename='/var/log/arduino.log',
filemode='a',
format='%(asctime)s %(mes... | #!/usr/bin/env python3
import serial
import datetime
import time
import logging
if __name__ == '__main__':
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
ser.flush()
logging.basicConfig(filename='/var/log/arduino.log',
filemode='a',
format='%(asctime)s %(mes... | fr | 0.221828 | #!/usr/bin/env python3 | 2.541533 | 3 |
matrix/transpose.py | shivam3009/fun-with-algorithms | 11 | 6621314 | <reponame>shivam3009/fun-with-algorithms
# coding: utf-8
def transpose(A):
""" returns the transpose of matrix A. """
return list(map(list, zip(*A)))
if __name__ in "__main__":
a = [[1, 2], [3, 4], [5, 6]]
print('A:')
print(a)
print('AT:')
print(transpose(a))
| # coding: utf-8
def transpose(A):
""" returns the transpose of matrix A. """
return list(map(list, zip(*A)))
if __name__ in "__main__":
a = [[1, 2], [3, 4], [5, 6]]
print('A:')
print(a)
print('AT:')
print(transpose(a)) | en | 0.760128 | # coding: utf-8 returns the transpose of matrix A. | 4.038348 | 4 |
tabcmd/commands/datasources_and_workbooks/runschedule_command.py | tableau/tabcmd | 3 | 6621315 | from tabcmd.commands.auth.session import Session
from tabcmd.commands.constants import Errors
from tabcmd.execution.localize import _
from tabcmd.execution.logger_config import log
from .datasources_and_workbooks_command import DatasourcesAndWorkbooks
class RunSchedule(DatasourcesAndWorkbooks):
"""
This comma... | from tabcmd.commands.auth.session import Session
from tabcmd.commands.constants import Errors
from tabcmd.execution.localize import _
from tabcmd.execution.logger_config import log
from .datasources_and_workbooks_command import DatasourcesAndWorkbooks
class RunSchedule(DatasourcesAndWorkbooks):
"""
This comma... | en | 0.844334 | This command runs the specified schedule as it is on the server. # TODO implement in REST/tsc | 2.136123 | 2 |
ports/stm32/boards/AEMICS_PYGGI/manifest.py | H-Grobben/micropython | 0 | 6621316 | <filename>ports/stm32/boards/AEMICS_PYGGI/manifest.py
include("$(PORT_DIR)/boards/manifest.py")
freeze("$(BOARD_DIR)", ("pyg.py"))
freeze("$(PORT_DIR)/boards/NUCLEO_WB55", "rfcore_firmware.py")
freeze("$(BOARD_DIR)", ("ble_repl.py"))
freeze("$(MPY_DIR)/drivers/neopixel", ("neopixel.py"))
| <filename>ports/stm32/boards/AEMICS_PYGGI/manifest.py
include("$(PORT_DIR)/boards/manifest.py")
freeze("$(BOARD_DIR)", ("pyg.py"))
freeze("$(PORT_DIR)/boards/NUCLEO_WB55", "rfcore_firmware.py")
freeze("$(BOARD_DIR)", ("ble_repl.py"))
freeze("$(MPY_DIR)/drivers/neopixel", ("neopixel.py"))
| none | 1 | 1.195981 | 1 | |
lab_05/src/main.py | Untouchabl3Pineapple/labs_py_02_sem | 1 | 6621317 | import sys, pygame
# ___________________________InitPyGame_____________________________
pygame.init()
size = width, height = 1250, 720
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Animation by <NAME> IU7-23B")
clock = pygame.time.Clock()
# ___________________________ImportImages_____________... | import sys, pygame
# ___________________________InitPyGame_____________________________
pygame.init()
size = width, height = 1250, 720
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Animation by <NAME> IU7-23B")
clock = pygame.time.Clock()
# ___________________________ImportImages_____________... | en | 0.298308 | # ___________________________InitPyGame_____________________________ # ___________________________ImportImages_____________________________ # ___________________________GlobalVars_____________________________ # ___________________________StartPositions_________________________ # ___________________________EventProcess_... | 2.810297 | 3 |
auto_repair_saas/apps/vehicles/views.py | wangonya/auto-repair-saas | 6 | 6621318 | <filename>auto_repair_saas/apps/vehicles/views.py
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.contrib.postgres.search import SearchVector
from django.http import HttpResponseRedirect
from django.s... | <filename>auto_repair_saas/apps/vehicles/views.py
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.contrib.postgres.search import SearchVector
from django.http import HttpResponseRedirect
from django.s... | none | 1 | 1.985949 | 2 | |
dqn_implementation/atari_dqn.py | a-nesse/acromuse_atari | 0 | 6621319 | <gh_stars>0
# Copyright 2021 <NAME>
#
# 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 2021 <NAME>
#
# 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, softw... | en | 0.837343 | # Copyright 2021 <NAME> # # 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, softw... | 2.007613 | 2 |
src/models/utils.py | saeedranjbar12/mtlcfci | 6 | 6621320 | import torch
import torch.nn as nn
from torch.autograd import Variable
#=========================================================
# Reconstruction
#=========================================================
class Conv2_recon(nn.Module):
def __init__(self, in_size, out_size, is_batchnorm):
super(C... | import torch
import torch.nn as nn
from torch.autograd import Variable
#=========================================================
# Reconstruction
#=========================================================
class Conv2_recon(nn.Module):
def __init__(self, in_size, out_size, is_batchnorm):
super(C... | fr | 0.334673 | #========================================================= # Reconstruction #========================================================= # saeed added padding ======================> ADD LEAKY RELU LeakyReLU #nn.BatchNorm2d(out_size) #, #nn.BatchNorm2d(out_size), #,nn.ReLU() #outputs = self.conv2(outputs) #=... | 2.564348 | 3 |
ml_dronebase_data_utils/__init__.py | DroneBase/ml-dronebase-utils | 2 | 6621321 | <filename>ml_dronebase_data_utils/__init__.py
from . import pascal_voc, s3 # noqa: F401
__author__ = "<NAME>"
__version__ = "0.0.1"
| <filename>ml_dronebase_data_utils/__init__.py
from . import pascal_voc, s3 # noqa: F401
__author__ = "<NAME>"
__version__ = "0.0.1"
| uz | 0.465103 | # noqa: F401 | 1.040447 | 1 |
SmartDoorAuthenticationSystem/lambda functions/LF2.py | DivyaPabba08/SmartDoorAuthenticationSystem | 0 | 6621322 | import json
import boto3
import time
from datetime import datetime, timezone
from random import randint
TABLE_DB1_NAME = 'DB1'
TABLE_DB2_NAME = 'DB2'
S3_BUCKET_NAME = 'assignment2-fall2020-faces'
def store_visitor(visitor):
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.Table... | import json
import boto3
import time
from datetime import datetime, timezone
from random import randint
TABLE_DB1_NAME = 'DB1'
TABLE_DB2_NAME = 'DB2'
S3_BUCKET_NAME = 'assignment2-fall2020-faces'
def store_visitor(visitor):
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.Table... | en | 0.358875 | # send sns messgae to visitor # TODO implement | 2.36989 | 2 |
apps/accounts/migrations/0002_add_more_fields.py | developersociety/commonslibrary | 4 | 6621323 | <filename>apps/accounts/migrations/0002_add_more_fields.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-06 10:56
from __future__ import unicode_literals
import django.contrib.postgres.fields.citext
from django.contrib.postgres.operations import CITextExtension
from django.db import mi... | <filename>apps/accounts/migrations/0002_add_more_fields.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-06 10:56
from __future__ import unicode_literals
import django.contrib.postgres.fields.citext
from django.contrib.postgres.operations import CITextExtension
from django.db import mi... | en | 0.632678 | # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-06 10:56 | 1.498566 | 1 |
virustotal_python/__init__.py | smk762/virustotal-python | 0 | 6621324 | from virustotal_python.virustotal import Virustotal
from virustotal_python.virustotal import VirustotalError
name = "virustotal-python"
| from virustotal_python.virustotal import Virustotal
from virustotal_python.virustotal import VirustotalError
name = "virustotal-python"
| none | 1 | 1.204957 | 1 | |
part2/prob_1.py | hasanmansur/drishtipat | 0 | 6621325 | <filename>part2/prob_1.py<gh_stars>0
import cv2
import math
import numpy as np
from matplotlib import pyplot as plt
from tkinter import filedialog
from tkinter import *
def on_mouse_over(event, x, y, flags, param):
global img
global dashboard
if event == cv2.cv2.EVENT_MOUSEMOVE:
img_reset()
... | <filename>part2/prob_1.py<gh_stars>0
import cv2
import math
import numpy as np
from matplotlib import pyplot as plt
from tkinter import filedialog
from tkinter import *
def on_mouse_over(event, x, y, flags, param):
global img
global dashboard
if event == cv2.cv2.EVENT_MOUSEMOVE:
img_reset()
... | en | 0.165426 | #print(img.shape) #str_mean = "mean: R:{} G:{} B:{}".format(mean[2],mean[1], mean[0]) #str_std = "standard deviation:" + "\n" + "R:{} G:{} B:{}".format(std[2],std[1], std[0]) #img = cv2.imread("testimage.png") #img = cv2.imread("testimage.png") | 2.777178 | 3 |
bin/db_build_dict.py | donalm/obstructx | 0 | 6621326 | #!/usr/bin/env python
import sys
import json
import argparse
from twisted.python import log
from collections import OrderedDict
appname = "obstructx"
from obstructx import config
config.Config.init()
from obstructx.log import get_logger
logger = get_logger(appname)
logger.error("OBSTRUCTX DATABASE SCHEMA TRAWLER")
... | #!/usr/bin/env python
import sys
import json
import argparse
from twisted.python import log
from collections import OrderedDict
appname = "obstructx"
from obstructx import config
config.Config.init()
from obstructx.log import get_logger
logger = get_logger(appname)
logger.error("OBSTRUCTX DATABASE SCHEMA TRAWLER")
... | ru | 0.26433 | #!/usr/bin/env python | 2.3456 | 2 |
explore_medium/sorting_and_searching/SortColors.py | niefy/LeetCodeExam | 0 | 6621327 | """
https://leetcode-cn.com/explore/interview/card/top-interview-questions-medium/50/sorting-and-searching/96/
题目:颜色分类
给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。
注意:
不能使用代码库中的排序函数来解决这道题。
示例:
输入: [2,0,2,1,1,0]
输出: [0,0,1,1,2,2]
进阶:
一个直观的解决方案是使用计数排序的两趟扫描算法。
首先... | """
https://leetcode-cn.com/explore/interview/card/top-interview-questions-medium/50/sorting-and-searching/96/
题目:颜色分类
给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。
注意:
不能使用代码库中的排序函数来解决这道题。
示例:
输入: [2,0,2,1,1,0]
输出: [0,0,1,1,2,2]
进阶:
一个直观的解决方案是使用计数排序的两趟扫描算法。
首先... | zh | 0.961477 | https://leetcode-cn.com/explore/interview/card/top-interview-questions-medium/50/sorting-and-searching/96/ 题目:颜色分类 给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。 此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。 注意: 不能使用代码库中的排序函数来解决这道题。 示例: 输入: [2,0,2,1,1,0] 输出: [0,0,1,1,2,2] 进阶: 一个直观的解决方案是使用计数排序的两趟扫描算法。 首先,迭代计... | 4.25224 | 4 |
FH_Assignment.py | FHealy90/EGM722_Assignment | 0 | 6621328 | # The print function allows us to print messages and information to the screen
print ( "Hello and welcome to my assignment for EGM722 - Programming for GIS and Remote Sensing"
"Designated Sites such as Special Areas of Conservation (SAC) 'and' Special Protection Areas"
"ensure the adequate conservation ... | # The print function allows us to print messages and information to the screen
print ( "Hello and welcome to my assignment for EGM722 - Programming for GIS and Remote Sensing"
"Designated Sites such as Special Areas of Conservation (SAC) 'and' Special Protection Areas"
"ensure the adequate conservation ... | en | 0.753696 | # The print function allows us to print messages and information to the screen # First import geopandas and load the data: # you will need to create your own file path here # you will need to create your own file path here # The data is stored in a table (a GeoDataFrame), much like the attribute table in ArcMap. # Nex... | 3.975613 | 4 |
misago/misago/users/online/tracker.py | vascoalramos/misago-deployment | 2 | 6621329 | <gh_stars>1-10
from django.utils import timezone
from rest_framework.request import Request
from ..models import Online
def mute_tracker(request):
request._misago_online_tracker = None
def start_tracking(request, user):
online_tracker = Online.objects.create(user=user)
request.user.online_tracker = on... | from django.utils import timezone
from rest_framework.request import Request
from ..models import Online
def mute_tracker(request):
request._misago_online_tracker = None
def start_tracking(request, user):
online_tracker = Online.objects.create(user=user)
request.user.online_tracker = online_tracker
... | en | 0.539981 | # Fugly unwrap restframework's request | 1.922247 | 2 |
bright/apigen/tests/test_cythongen.py | bright-dev/bright | 3 | 6621330 | <reponame>bright-dev/bright<gh_stars>1-10
from bright.apigen import typesystem as ts
from bright.apigen import cythongen as cg
from nose.tools import assert_equal
toaster_desc = {
'name': 'Toaster',
'header_filename': 'toaster.h',
'cpppxd_filename': 'cpp_toaster.pxd',
'namespace': 'bright',
'docst... | from bright.apigen import typesystem as ts
from bright.apigen import cythongen as cg
from nose.tools import assert_equal
toaster_desc = {
'name': 'Toaster',
'header_filename': 'toaster.h',
'cpppxd_filename': 'cpp_toaster.pxd',
'namespace': 'bright',
'docstrings': {
'module': "I am the Toas... | en | 0.452442 | from libcpp.string cimport string as std_string from pyne cimport extra_types cdef extern from "toaster.h" namespace "bright": cdef cppclass Toaster(FCComp): # constructors Toaster() except + ~Toaster() except + # attributes extra_types.uint nslices double rate ... | 2.053107 | 2 |
cleanup_garbage.py | nilleb/adb-expertise-locator | 0 | 6621331 | <reponame>nilleb/adb-expertise-locator
import os
from common.folder_processor import DEFAULT_FOLDERS, FolderProcessor
from common.io import read_object
def process_file(filepath):
if not os.path.exists(filepath.replace('.metadata.json', '')):
metadata = read_object(filepath)
if not metadata.get('pa... | import os
from common.folder_processor import DEFAULT_FOLDERS, FolderProcessor
from common.io import read_object
def process_file(filepath):
if not os.path.exists(filepath.replace('.metadata.json', '')):
metadata = read_object(filepath)
if not metadata.get('pages'):
os.unlink(filepath)
... | none | 1 | 2.268257 | 2 | |
graphs/models/onedcnn.py | jkrishnan95v/Signal_detector | 2 | 6621332 | <filename>graphs/models/onedcnn.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 11:23:27 2021
@author: jay
"""
import config
import torch.nn as nn
class OneDCNN(nn.Module):
def __init__(self,config):
super().__init__()
self.config = config
self.num_classes = sel... | <filename>graphs/models/onedcnn.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 11:23:27 2021
@author: jay
"""
import config
import torch.nn as nn
class OneDCNN(nn.Module):
def __init__(self,config):
super().__init__()
self.config = config
self.num_classes = sel... | en | 0.486091 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Fri Jun 4 11:23:27 2021 @author: jay # 420 x 1 # 140 x 128 # 48 x 128 # 16 x 128 # 5 x 256 # 1 x 512 #Keep numnber of output layers to number of signals being classified # input x : 23 x 59049 x 1 # expected conv1d input : minibatch_size x num_channel x width ... | 2.592311 | 3 |
python/src/problem042.py | arturh85/projecteuler | 3 | 6621333 | <reponame>arturh85/projecteuler<gh_stars>1-10
'''
Problem 42
25 April 2003
The nth term of the sequence of triangle numbers is given by, tn = 1/2 n(n+1); so the first ten triangle numbers are:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
By converting each letter in a word to a number corresponding to its alphab... | '''
Problem 42
25 April 2003
The nth term of the sequence of triangle numbers is given by, tn = 1/2 n(n+1); so the first ten triangle numbers are:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
By converting each letter in a word to a number corresponding to its alphabetical position and adding these values
we fo... | en | 0.729489 | Problem 42
25 April 2003
The nth term of the sequence of triangle numbers is given by, tn = 1/2 n(n+1); so the first ten triangle numbers are:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
By converting each letter in a word to a number corresponding to its alphabetical position and adding these values
we form a ... | 3.922983 | 4 |
api_rest/migrations/0005_auto_20200828_0903.py | ccortes1/Event5-Data | 1 | 6621334 | # Generated by Django 3.1 on 2020-08-28 14:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_rest', '0004_auto_20200828_0749'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='user_id',
... | # Generated by Django 3.1 on 2020-08-28 14:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_rest', '0004_auto_20200828_0749'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='user_id',
... | en | 0.752908 | # Generated by Django 3.1 on 2020-08-28 14:03 | 1.468151 | 1 |
tests/test_column.py | tamuto/columnarframe | 0 | 6621335 | import unittest
import columnarframe as colf
class TestColumn(unittest.TestCase):
def setUp(self):
self.cf = colf.ColumnarFrame({
'col1': ['AAA', None, 'CCC', 'CCC', 'DDD'],
'col2': ['1', '5', '8', '3', None],
'col4': ['True', 'False', 'False', None, 'True'],
... | import unittest
import columnarframe as colf
class TestColumn(unittest.TestCase):
def setUp(self):
self.cf = colf.ColumnarFrame({
'col1': ['AAA', None, 'CCC', 'CCC', 'DDD'],
'col2': ['1', '5', '8', '3', None],
'col4': ['True', 'False', 'False', None, 'True'],
... | none | 1 | 3.232143 | 3 | |
cdn_static_website/settings/components/templates.py | soulraven/cdn_small | 0 | 6621336 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2021 ProGeek
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2021 ProGeek
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | en | 0.838745 | # -*- coding: utf-8 -*- # # Copyright (C) 2018-2021 ProGeek # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v... | 1.594416 | 2 |
prozhito_app/models.py | apjanco/prozhito_db | 0 | 6621337 | from django.contrib.gis.db import models
from djgeojson.fields import PointField
# Create your models here.
class Place(models.Model):
name = models.CharField(max_length=220, blank=True, null=True)
wiki = models.URLField(max_length=250, blank=True)
geom = models.PointField(null=True, blank=True)
@pr... | from django.contrib.gis.db import models
from djgeojson.fields import PointField
# Create your models here.
class Place(models.Model):
name = models.CharField(max_length=220, blank=True, null=True)
wiki = models.URLField(max_length=250, blank=True)
geom = models.PointField(null=True, blank=True)
@pr... | en | 0.963489 | # Create your models here. | 2.587166 | 3 |
discovery-infra/test_infra/helper_classes/kube_helpers/installenv.py | RazRegev/assisted-test-infra | 0 | 6621338 | import re
from typing import Optional, Union, Dict
from pprint import pformat
import yaml
import waiting
from kubernetes.client import ApiClient, CustomObjectsApi
from kubernetes.client.rest import ApiException
from tests.conftest import env_variables
from .base_resource import BaseCustomResource
from .cluster_deploy... | import re
from typing import Optional, Union, Dict
from pprint import pformat
import yaml
import waiting
from kubernetes.client import ApiClient, CustomObjectsApi
from kubernetes.client.rest import ApiException
from tests.conftest import env_variables
from .base_resource import BaseCustomResource
from .cluster_deploy... | en | 0.898156 | Proxy settings for the installation. Args: http_proxy (str): endpoint for accessing in every HTTP request. https_proxy (str): endpoint for accessing in every HTTPS request. no_proxy (str): comma separated values of addresses/address ranges/DNS entries that shouldn't be accessed ... | 1.999655 | 2 |
lib/helpers/FilesWalker.py | PetukhovVictor/ast-set2matrix | 4 | 6621339 | from os import path
import glob
class FilesWalker:
@staticmethod
def walk(folder, callback, extension='json'):
for filename in glob.iglob(folder + '/**/*.' + extension, recursive=True):
if path.isfile(filename):
callback(filename)
| from os import path
import glob
class FilesWalker:
@staticmethod
def walk(folder, callback, extension='json'):
for filename in glob.iglob(folder + '/**/*.' + extension, recursive=True):
if path.isfile(filename):
callback(filename)
| none | 1 | 3.128265 | 3 | |
programs/koinos-types/testme.py | joticajulian/koinos-types | 10 | 6621340 |
from dataclasses_json import dataclass_json
from dataclasses import dataclass, field
from typing import List, Tuple, Optional, Union
@dataclass_json
@dataclass
class Node:
name: str
sub: Union["AlphaNode", "BetaNode"]
@dataclass_json
@dataclass
class AlphaNode:
suba: Node
@dataclass_json
@dataclass
cla... |
from dataclasses_json import dataclass_json
from dataclasses import dataclass, field
from typing import List, Tuple, Optional, Union
@dataclass_json
@dataclass
class Node:
name: str
sub: Union["AlphaNode", "BetaNode"]
@dataclass_json
@dataclass
class AlphaNode:
suba: Node
@dataclass_json
@dataclass
cla... | none | 1 | 2.763861 | 3 | |
sentilab/sentiment/sentiment_menu.py | Sean-Koval/sentilab | 1 | 6621341 | import argparse
from sentilab import feature_flags as ff
from sentilab.helper_functions import get_flair
from sentilab.menu import session
from sentilab.sentiment import reddit_api
from prompt_toolkit.completion import NestedCompleter
def print_sentiment():
""" Print help """
print("\nSentiment:")
print... | import argparse
from sentilab import feature_flags as ff
from sentilab.helper_functions import get_flair
from sentilab.menu import session
from sentilab.sentiment import reddit_api
from prompt_toolkit.completion import NestedCompleter
def print_sentiment():
""" Print help """
print("\nSentiment:")
print... | en | 0.628886 | Print help # Add list of arguments that the discovery parser accepts # Loop forever and ever # Get input command from user # Parse sentiment command of the list of possible commands # Just leave the DISC menu # Abandon the program # pylint: disable=import-outside-toplevel # pylint: disable=import-outside-toplevel | 2.907157 | 3 |
controller/store/counter_controller.py | mallycrip/Flask-DI-example | 0 | 6621342 | from flask import request
from dataclasses import dataclass
from injector import inject
from controller.base_resource import StoreResource
from service.store_service import StoreService
@inject
@dataclass
class CounterController(StoreResource):
store_service: StoreService
def get(self):
store_id = r... | from flask import request
from dataclasses import dataclass
from injector import inject
from controller.base_resource import StoreResource
from service.store_service import StoreService
@inject
@dataclass
class CounterController(StoreResource):
store_service: StoreService
def get(self):
store_id = r... | none | 1 | 2.417183 | 2 | |
ipkg/files/backends/http.py | pmuller/ipkg | 3 | 6621343 | <filename>ipkg/files/backends/http.py
import logging
import requests
from . import BaseFile, BackendException
from .. import cache
from ...compat import StringIO
LOGGER = logging.getLogger(__name__)
class HttpFileException(BackendException):
"""An error occurred while accessing a file over HTTP/s."""
class ... | <filename>ipkg/files/backends/http.py
import logging
import requests
from . import BaseFile, BackendException
from .. import cache
from ...compat import StringIO
LOGGER = logging.getLogger(__name__)
class HttpFileException(BackendException):
"""An error occurred while accessing a file over HTTP/s."""
class ... | en | 0.847544 | An error occurred while accessing a file over HTTP/s. A file on a remote HTTP server. | 3.011606 | 3 |
decision-science/lab1/task3.py | Foltrex/bsu | 113 | 6621344 | out = open('output.txt', 'w')
H = [[14, -4, 2], [-4, 8, 8], [4, 4, 4], [2, 8, 2]]
p = [1./4, 0, 1./4, 1./2]
q = [1./3, 1./3, 1./3]
ans = 0
for i in range(4):
for j in range(3):
out.write('+ ({0}*{1}*{2:.2f}) '.format(H[i][j], p[i], q[j]))
ans += H[i][j]*p[i]*q[j]
out.write('= {}'.format(ans))
| out = open('output.txt', 'w')
H = [[14, -4, 2], [-4, 8, 8], [4, 4, 4], [2, 8, 2]]
p = [1./4, 0, 1./4, 1./2]
q = [1./3, 1./3, 1./3]
ans = 0
for i in range(4):
for j in range(3):
out.write('+ ({0}*{1}*{2:.2f}) '.format(H[i][j], p[i], q[j]))
ans += H[i][j]*p[i]*q[j]
out.write('= {}'.format(ans))
| none | 1 | 2.428059 | 2 | |
fix_dataset.py | MagazzuGaetano/Face-Detector | 0 | 6621345 | import os
import cv2
import numpy as np
data_path = '/home/lfx/Downloads/dtd/images'
images = []
for subdir, dirs, files in os.walk(data_path):
for file in files:
#print(os.path.join(subdir, file))
image = cv2.imread(os.path.join(subdir, file))
output_path = os.path.join('/home/lfx/Downl... | import os
import cv2
import numpy as np
data_path = '/home/lfx/Downloads/dtd/images'
images = []
for subdir, dirs, files in os.walk(data_path):
for file in files:
#print(os.path.join(subdir, file))
image = cv2.imread(os.path.join(subdir, file))
output_path = os.path.join('/home/lfx/Downl... | ceb | 0.172333 | #print(os.path.join(subdir, file)) | 2.766203 | 3 |
NPS Exercise Files/Chapter 7/7-9.py | coderXeno/eric-matthes-py-book-solutions | 0 | 6621346 | sandwich_orders = ['cheese','onion','pastrami','ham','pork','pastrami','tomato','egg','pastrami']
print("The deli has run out of pastrami")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
finished_sandwiches = []
while sandwich_orders:
current_order = sandwich_orders.pop()
... | sandwich_orders = ['cheese','onion','pastrami','ham','pork','pastrami','tomato','egg','pastrami']
print("The deli has run out of pastrami")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
finished_sandwiches = []
while sandwich_orders:
current_order = sandwich_orders.pop()
... | none | 1 | 3.753608 | 4 | |
scraper/__init__.py | farjanul-nayem/Web-Scraping-with-Python | 30 | 6621347 | <gh_stars>10-100
"""Scrape metadata from target URL."""
import requests
from bs4 import BeautifulSoup
import pprint
from .scrape import (
get_title,
get_description,
get_image,
get_site_name,
get_favicon,
get_theme_color
)
def scrape_page_metadata(url):
"""Scrape target URL for metadata.""... | """Scrape metadata from target URL."""
import requests
from bs4 import BeautifulSoup
import pprint
from .scrape import (
get_title,
get_description,
get_image,
get_site_name,
get_favicon,
get_theme_color
)
def scrape_page_metadata(url):
"""Scrape target URL for metadata."""
headers = {... | en | 0.182802 | Scrape metadata from target URL. Scrape target URL for metadata. | 3.352288 | 3 |
word_gen.py | tonyaajjackson/aloke | 0 | 6621348 | <reponame>tonyaajjackson/aloke
#! usr/bin/ python3
import numpy
import random
def word_gen(prob, n_words):
new_words = []
for x in range(n_words):
end_of_word = False
prev_letter = 0
word = ""
# Add loop counter to catch if loop gets stuck
loops = 0
while not e... | #! usr/bin/ python3
import numpy
import random
def word_gen(prob, n_words):
new_words = []
for x in range(n_words):
end_of_word = False
prev_letter = 0
word = ""
# Add loop counter to catch if loop gets stuck
loops = 0
while not end_of_word:
rand_pr... | en | 0.521974 | #! usr/bin/ python3 # Add loop counter to catch if loop gets stuck # Find a letter corresponding to this probability | 3.708617 | 4 |
496. Next Greater Element I/main.py | Competitive-Programmers-Community/LeetCode | 2 | 6621349 | <reponame>Competitive-Programmers-Community/LeetCode
class Solution:
def nextGreaterElement(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
res=[]
for e in nums1:
m=e
for i in range(... | class Solution:
def nextGreaterElement(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
res=[]
for e in nums1:
m=e
for i in range(len(nums2)):
if nums2[i]==e:
... | en | 0.11888 | :type nums1: List[int] :type nums2: List[int] :rtype: List[int] | 3.347814 | 3 |
tests/test_epsilon_nfa.py | cxlvinchau/automata-py | 3 | 6621350 | import unittest
from automatapy.automata import EpsilonNFA, Epsilon
class EpsilonNFATest(unittest.TestCase):
def setUp(self) -> None:
self.eps_nfa = EpsilonNFA()
q1, q2, q3 = self.eps_nfa.add_state(initial=True), self.eps_nfa.add_state(final=True), self.eps_nfa.add_state(final=True)
self... | import unittest
from automatapy.automata import EpsilonNFA, Epsilon
class EpsilonNFATest(unittest.TestCase):
def setUp(self) -> None:
self.eps_nfa = EpsilonNFA()
q1, q2, q3 = self.eps_nfa.add_state(initial=True), self.eps_nfa.add_state(final=True), self.eps_nfa.add_state(final=True)
self... | none | 1 | 3.36107 | 3 |