max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
Oscar/Helpers/Watchdog.py
onderogluserdar/boardInstrumentFramework
16
12778951
############################################################################## # Copyright (c) 2016 Intel 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....
1.476563
1
bunny/ext/const.py
senpai-development/SenpaiSlasher
0
12778952
from numbers import Number from string import ascii_letters __version__ = None class Version: """A simplified class to return a formatted version.""" def __new__(cls, *args) -> None: if isinstance([arg for arg in args], Number): if args[-1] not in ascii_letters: return ["...
3.484375
3
baselines/maml_torch/utils.py
mikehuisman/metadl
26
12778953
<reponame>mikehuisman/metadl<filename>baselines/maml_torch/utils.py import tensorflow as tf def create_grads_shell(model): """ Create list of gradients associated to each trainable layer in model. Returns: ------- list_grads, array-like : each element of this list is tensor representing t...
2.484375
2
src/changie/utils.py
ZaX51/changie
0
12778954
def read_file(file): with open(file, "r") as f: return f.read() def write_file(file, s): with open(file, "w+") as f: return f.write(s)
3.328125
3
Emmanuel/Notebooks/Eda.py
daye-oa/Data-Science-Projects
0
12778955
my first work
1.492188
1
evosax/experimental/decodings/random.py
RobertTLange/evosax
102
12778956
import jax import chex from typing import Union, Optional from .decoder import Decoder from ...utils import ParameterReshaper class RandomDecoder(Decoder): def __init__( self, num_encoding_dims: int, placeholder_params: Union[chex.ArrayTree, chex.Array], rng: chex.PRNGKey = jax.ran...
2.53125
3
ryu/lib/packet/wifi.py
SyedDanialAliShah/ryu
0
12778957
<reponame>SyedDanialAliShah/ryu # Copyright (C) 2016 Nippon Telegraph and Telephone 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.0625
2
model/attention/width_att.py
dora-alvarado/wanet-retinal-vessel-segmentation
2
12778958
############################################################################## # Created by: <NAME> # Email: <EMAIL> # # Note: This code was heavily inspired from https://github.com/junfu1115/DANet ############################################################################## from __future__ import division from torch....
2.53125
3
tests/dummy_storage.py
voidfiles/ssshelf
0
12778959
<gh_stars>0 class DummyStorage(object): def __init__(self, *args, **kwargs): self.create_key_call_count = 0 self.get_key_call_count = 0 self.get_keys_call_count = 0 self.remove_key_call_count = 0 self.remove_keys_call_count = 0 async def create_key(self, *args, **kwar...
2.5
2
src/algorithms/04-graph-algorithms/graph.py
SamVanhoutte/python-musings
0
12778960
<filename>src/algorithms/04-graph-algorithms/graph.py import numpy as np from enum import Enum class VertexState(Enum): Open = 0 Wip = 1 Closed = -1 class Vertex: def __init__(self, n): self.name = n self.state = VertexState.Open def print(self): print('Vertex', self.name, ':', self.state) class Graph: ...
3.515625
4
app/user/migrations/0046_auto_20170826_0132.py
Sovol2018/sovolo
2
12778961
<filename>app/user/migrations/0046_auto_20170826_0132.py # -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-25 16:32 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user'...
1.671875
2
scraper/storage_spiders/viettelstorevn.py
chongiadung/choinho
0
12778962
<gh_stars>0 # Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='col-lg-7 col-md-7 col-sm-7 col-xs-7 produce-info']/div[@class='row'][1]/div/h1", 'price' : "//div/span[@id='...
2.015625
2
model.py
ckyeungac/DeepIRT
38
12778963
import logging import numpy as np import tensorflow as tf from tensorflow.contrib import slim from tensorflow.contrib import layers from memory import DKVMN from utils import getLogger # set logger logger = getLogger('Deep-IRT-model') def tensor_description(var): """Returns a compact and informative string about a...
2.59375
3
functions/nag_function_is_output.py
daviddoret/pyxag
1
12778964
<reponame>daviddoret/pyxag<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Sun Oct 27 12:15:58 2019 @author: david """ def nag_function_is_output(name): """ Check wether a NAG function name is of type output """ if name[0:1] == 'o': return True else: return False
2.65625
3
app.py
Sk70249/Book-Data-Scraprer
1
12778965
import requests from pages.book_pages import AllBooksPage # For extracting data from single page of a Website page_content = requests.get("http://books.toscrape.com/index.html").content page = AllBooksPage(page_content) books = page.books # Far extracting data from multiple pages of a Website for p_num in range(1, p...
3.625
4
meadow/meadow/tests/utils/test_book_searcher.py
digital-gachilib/meadow
0
12778966
<gh_stars>0 from django.test import TestCase from meadow.models import Book from meadow.tests.factories.book import BookFactory from meadow.utils.book_searcher import book_preview, search_by_title class BookPreviewTestCase(TestCase): def test_book_preview_book_exists(self): some_book = BookFactory() ...
2.765625
3
tangoObjects.py
15-411/Tango
2
12778967
# tangoREST.py # # Implements objects used to pass state within Tango. # import redis import pickle import Queue import logging from datetime import datetime, timedelta from config import Config redisConnection = None # Pass in an existing connection to redis, sometimes necessary for testing. def getRedisConnection(c...
2.515625
3
test.py
DITDSI/Projet1
0
12778968
print("test avec git")
0.714844
1
einvoice/einvoice/data/create_sample_data.py
BPC-OpenSourceTools/Discovery-Tools
2
12778969
<gh_stars>1-10 #!/usr/bin/env python3 # pylint: disable=R0902, W1514 # disabling "Too many instance attributes," "using open without specifying and # endcoding,"" which is a known bug in pylint. # File: create_sample_data.py # About: Create test e-Invoices using fake data sets. # Development: <NAME> # Date: 2021-06-22 ...
2.578125
3
playlist/myPlaylist.py
seanomisteal/PythonPlay
0
12778970
<filename>playlist/myPlaylist.py import plistlib def main(): filename = "test-data\maya.xml" #findDuplicates(filename) #filenames = ("test-data\pl1.xml", "test-data\pl2.xml") #findCommonTracks(filenames) filename = "test-data\mymusic.xml" plotStats(filename) def plotStats(filename): # rea...
3.375
3
subastas_repo/personas/models.py
diegoduncan21/subastas
0
12778971
# -*- coding: utf-8 -*- from django.db import models from model_utils import Choices class Persona(models.Model): nombres = models.CharField(max_length=100, blank=True, null=True) apellidos = models.CharField(max_length=100, blank=True, null=True) razon_social = models.CharField(max_length=100, blank=Tr...
2.171875
2
exp_runner/interfaces.py
slipnitskaya/exp-runner
3
12778972
<filename>exp_runner/interfaces.py import abc from typing import Any from typing import Dict from typing import List from typing import Tuple from typing import Union from typing import Iterable from typing import NoReturn class Dataset(abc.ABC): @abc.abstractmethod def __getitem__(self, index: int) -> Any:...
2.546875
3
kadal/reliability_analysis/akmcs.py
timjim333/KADAL
7
12778973
<filename>kadal/reliability_analysis/akmcs.py import time import numpy as np import matplotlib.pyplot as plt from kadal.misc.sampling.samplingplan import realval from kadal.testcase.RA.testcase import evaluate class AKMCS: """Create AK-MCS model for reliability analysis (Active Kriging - Monte Carlo Simulat...
2.390625
2
sandbox/test_Linux.py
gwiederhecker/MPh
1
12778974
<gh_stars>1-10 """ Tests running a stand-alone Comsol client on Linux. The script does not depend on MPh, but starts the Comsol client directly via the Java bridge JPype. Paths to the Comsol installation are hard-coded for an installation of Comsol 5.6 at the default location. Other versions can be tested by ed...
2.25
2
data/studio21_generated/introductory/4746/starter_code.py
vijaykumawat256/Prompt-Summarization
0
12778975
def fisHex(name):
1.0625
1
backend/phonebook/employees/views.py
unmade/phonebook
0
12778976
from rest_framework import generics from .models import Employee from .serializers import EmployeeSerializer class EmployeeListAPIView(generics.ListAPIView): queryset = Employee.objects.select_name().select_job().prefetch_contacts().prefetch_secretaries() serializer_class = EmployeeSerializer search_fiel...
2.140625
2
upscale/api/keys.py
nl5887/upscale
1
12778977
<reponame>nl5887/upscale<filename>upscale/api/keys.py import sys, getopt, os import argparse import shlex import yaml import git import shutil import subprocess from jinja2 import Template import tempfile import git import base64 import logging from sqlalchemy.sql import exists from sqlalchemy.sql import and_, or_, no...
2.28125
2
scarletio/utils/compact.py
HuyaneMatsu/scarletio
3
12778978
<filename>scarletio/utils/compact.py __all__ = () # Test for pypy bug: # https://foss.heptapod.net/pypy/pypy/issues/3239 class dummy_init_tester: def __new__(cls, value): return object.__new__(cls) __init__ = object.__init__ try: dummy_init_tester(None) except TypeError: NEEDS_DUMMY_INIT = Tru...
1.976563
2
ncbi_taxonomy/gi_to_taxon.py
dacuevas/bioinformatics
0
12778979
<reponame>dacuevas/bioinformatics #!/usr/local/bin/python3 # gi_to_taxon.py # Collect taxonomy information for given GI numbers # # Author: <NAME> (<EMAIL>) # Created on 07 Aug 2017 # Updated on 08 Aug 2017 from __future__ import print_function, absolute_import, division import sys import os import time import dateti...
2.234375
2
bookorbooks/country/api/views/country_views.py
talhakoylu/SummerInternshipBackend
1
12778980
<reponame>talhakoylu/SummerInternshipBackend from rest_framework.generics import ListAPIView, RetrieveAPIView from country.models import Country from country.api.serializers import CountrySerializer, CountryDetailWithCitySerializer class CountryListAPIView(ListAPIView): queryset = Country.objects.all() serial...
2.234375
2
src/deephaven_ib/_internal/short_rates.py
deephaven-examples/deephaven-ib
2
12778981
<reponame>deephaven-examples/deephaven-ib<filename>src/deephaven_ib/_internal/short_rates.py<gh_stars>1-10 """Functionality for working with short rates.""" import ftplib import html import tempfile from deephaven import read_csv from deephaven.table import Table class IBFtpWriter: """Writer for downloading tex...
3.140625
3
esteganography/fileManipulation.py
giovaninppc/MC920
1
12778982
<reponame>giovaninppc/MC920 import numpy as np from skimage import io def openImage(path: str, gray: bool = False): return io.imread(path, as_gray = gray) def saveImage(path: str, img): io.imsave(path, img) def openTextFile(path): file = open(path, 'r') txt = file.read() file.close() return t...
2.78125
3
ceph-plugins/check_ceph_health.py
DeltaBG/icinga2-plugins
2
12778983
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2013-2016 SWITCH http://www.switch.ch # # 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/licens...
2.125
2
scripts/experiment_synth_nparity.py
accosmin/zob
6
12778984
from config import * from experiment import * # initialize experiment: # - classification problem: predict the parity bit of binary inputs cfg = config.config() exp = experiment(cfg.expdir + "/synth_nparity", trials = 10) exp.set_task(cfg.task_synth_nparity(n = 8, count = 10000)) # loss functions exp.add_loss("logis...
2.34375
2
mesh_tensorflow/transformer/vocab_embeddings.py
bmaier96/mesh
0
12778985
<filename>mesh_tensorflow/transformer/vocab_embeddings.py # coding=utf-8 # Copyright 2020 The Mesh TensorFlow 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.apach...
2.0625
2
config.py
kia-kia/IC-MLNet
2
12778986
from easydict import EasyDict D = EasyDict() D.num_gpus = 4 D.batch_size = 24 D.epochs = 80 D.decay_epochs = 20 D.decay_rate = 0.5 D.learning_rate = 1e-3 D.input_dataset = 'ec_pf_tp_AT24_33x33_025' #'multiorigin_cf_tp_AT24_33x33_025' D.block_type = 'nolocal2d' # nolocal2d conv2d D.merge_type = 'add' # concat add ...
1.554688
2
dens_lim.py
wdeshazer/gt3
1
12778987
<reponame>wdeshazer/gt3<gh_stars>1-10 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Apr 10 20:24:53 2018 @author: max """ from __future__ import division import numpy as np from scipy.special import jv import sys from math import sqrt import matplotlib.pyplot as plt def calc_quadratic(a, b, c): ...
2.5
2
sideboard/_version.py
EliAndrewC/sideboard
0
12778988
from __future__ import unicode_literals __version__ = '0.1.0'
1.085938
1
nipype/interfaces/tests/test_auto_SelectFiles.py
nicholsn/nipype
1
12778989
<gh_stars>1-10 # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.io import SelectFiles def test_SelectFiles_inputs(): input_map = dict(base_directory=dict(), force_lists=dict(usedefault=True, ), ignore_exception=dict(nohash=True, us...
2.09375
2
binary_search_tree.py
alexsmartens/algorithms
0
12778990
# This binary_search_tree.py is an implementation of binary search tree based on the idea from CLRS, Chapter 12 from tree_visualization import tree_visualize class Binary_tree: def __init__(self): self.root = None def node(self, key, p=None, left=None, right=None): return { ...
4.15625
4
laskea/config.py
sthagen/laskea
1
12778991
<reponame>sthagen/laskea """Configuration API for laskea.""" import copy import json import os import pathlib import sys from typing import Dict, List, Mapping, Tuple, no_type_check import jmespath import laskea import laskea.api.jira as api TEMPLATE_EXAMPLE = """\ { "table": { "column": { "fields": [ ...
1.78125
2
services/database.py
njncalub/logistiko
0
12778992
<filename>services/database.py<gh_stars>0 from core import settings from data.services import DataService def get_database(): db = DataService(engine=settings.DATABASE_URL) return db db_service = get_database()
1.75
2
splashgen/components/CTAButton.py
ndejong/splashgen
246
12778993
from splashgen import Component class CTAButton(Component): def __init__(self, link: str, text: str) -> None: self.link = link self.text = text def render(self) -> str: return f'<a href="{self.link}" class="btn btn-primary btn-lg px-4">{self.text}</a>'
2.53125
3
tensorforce/core/parameters/ornstein_uhlenbeck.py
stheid/tensorforce
1
12778994
<reponame>stheid/tensorforce # Copyright 2018 Tensorforce Team. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
2.375
2
recupero/migrations/0003_tipoprestacion_anio_update.py
cluster311/ggg
6
12778995
# Generated by Django 2.2.4 on 2019-11-03 15:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recupero', '0002_auto_20191103_1159'), ] operations = [ migrations.AddField( model_name='tipoprestacion', name='anio...
1.546875
2
MyWatchList/views/ErrorsHandler.py
fgl-foundation/MovieDB
0
12778996
from django.shortcuts import render def error_404(request,*args, **argv): data = {} return render(request, 'error_404.html', data)
1.632813
2
bento/commands/tests/test_command_contexts.py
cournape/Bento
55
12778997
<reponame>cournape/Bento from bento.commands.registries \ import \ _RegistryBase from bento.compat.api import moves class Test_RegistryBase(moves.unittest.TestCase): def test_simple(self): registry = _RegistryBase() registry.register_category("dummy", lambda: 1) registry.registe...
2.40625
2
glassyiffpy/horni.py
Deltara3/glassyiffpy
0
12778998
import requests, random, time from bs4 import BeautifulSoup #These functions are what I should have used in the first place lol def getter(url): #extracts images from a url and returns all the images as a list try: imglist = [] page = requests.get(url) soup = BeautifulSoup(page.content, 'html....
2.828125
3
mundo3-EstruturasCompostas/072-NumeroPorExtenso.py
jonasht/CursoEmVideo-CursoDePython3
0
12778999
<reponame>jonasht/CursoEmVideo-CursoDePython3<filename>mundo3-EstruturasCompostas/072-NumeroPorExtenso.py #Exercício Python 072: # Crie um programa que tenha uma dupla totalmente preenchida com uma contagem por extenso, de zero até vinte. # Seu programa deverá ler um número pelo teclado (entre 0 e 20) e mostrá-lo por e...
3.96875
4
senic_hub/backend/tests/test_setup_config.py
neelotpalnag/senic-hub
2
12779000
from unittest import mock from pytest import fixture @fixture def url(route_url): return route_url('configuration') @mock.patch('senic_hub.backend.commands.supervisor.program_status') @mock.patch('senic_hub.backend.commands.supervisor.start_program') @mock.patch('senic_hub.backend.views.config.sleep') @mock.pa...
2.203125
2
print_pdfs_dynamic_website.py
hhalaby/web-crawling-automation
2
12779001
<reponame>hhalaby/web-crawling-automation<filename>print_pdfs_dynamic_website.py import os.path import random import string import time import ait import pyautogui from selenium import webdriver from selenium.common.exceptions import ElementClickInterceptedException from selenium.common.exceptions import StaleElementR...
2.671875
3
python/redmine.py
Y05H1/rtv
0
12779002
<filename>python/redmine.py # -*- coding: utf-8 -*- import json from datetime import datetime, date, timedelta from dateutil.relativedelta import relativedelta import dateutil.parser import numpy as np class RedmineAnalyzer(object): def __init__(self, rc): self.rc = rc def _get_id(self, path='', list_name=''...
2.578125
3
lib/checkpoint.py
kaolin/rigor
5
12779003
""" Saved progress for Rigor, allowing users to resume long-running runs that fail part way through """ import rigor.logger import tempfile import time import cPickle as pickle import os kPickleProtocol = pickle.HIGHEST_PROTOCOL class Checkpoint(object): """ Saved checkpoint results, loaded from a file """ def __...
2.953125
3
deep_learning_from_scratch/4_activation_function.py
wdxtub/deep-learning-note
37
12779004
<reponame>wdxtub/deep-learning-note import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt # 阶跃函数 def step_function0(x): if x > 0: return 1 return 0 # 支持 Numpy 数组的实现 def step_function(x): return np.array(x > 0, dtype=np.int) # 简单测试一下 x = np.array([-1.0, 1....
3.390625
3
bin/grad_desc.py
FrankSchaust/SC2CombatPredictor
0
12779005
#!/usr/bin/env python3 # Copyright 2017 <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
2.34375
2
webhook.py
xelnagamex/conf_bot
0
12779006
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- from http.server import HTTPServer,SimpleHTTPRequestHandler,CGIHTTPRequestHandler from socketserver import BaseServer import ssl import json import settings # fuckin dirty hack. idk the best way to inherit return func into # RequestHandler class class Reques...
2.4375
2
selenium_study/test_case/testwb_researchweibo.py
songxiaoshi/automation_case
0
12779007
<reponame>songxiaoshi/automation_case<gh_stars>0 # code = 'utf-8' import unittest import xlwt from selenium import webdriver from selenium.webdriver.common.by import By import sys from PO.weibopagelist import wbplist # from selenium.webdriver.support.wait import WebDriverWait #显示等待 # from selenium.webdriver.sup...
2.546875
3
src/Python/801-900/867.TransposeMatrix.py
Peefy/PeefyLeetCode
2
12779008
<reponame>Peefy/PeefyLeetCode class Solution: def transpose(self, A): """ :type A: List[List[int]] :rtype: List[List[int]] """ A[:] = map(list,zip(*A)) return A if __name__ == '__main__': solution = Solution() print(solution.transpose([[1, 2, 3], [4, 5, 6],...
3.4375
3
src/koala/lattice.py
Imperial-CMTH/koala
0
12779009
<filename>src/koala/lattice.py import numpy as np import numpy.typing as npt from dataclasses import dataclass, field from functools import cached_property import matplotlib.transforms INVALID = np.iinfo(int).max class LatticeException(Exception): pass @dataclass class Plaquette: """Represents a single plaqu...
2.9375
3
utilities/CGI-pythons/surf_trajLL2.py
sinotec2/Focus-on-Air-Quality
0
12779010
#!/usr/bin/python # -*- coding: UTF-8 -*- import cgi, os, sys import cgitb import tempfile as tf import json #paths JSON='/Users/Data/cwb/e-service/surf_trj/sta_list.json' TRJs={'forc':'/Users/Data/cwb/e-service/btraj_WRFnests/ftuv10.py','obsv':'/Users/Data/cwb/e-service/surf_trj/traj2kml.py'} WEB='/Library/WebServe...
2.109375
2
integration_tests/module_detection.py
pieperm/IARC-2020
12
12779011
<filename>integration_tests/module_detection.py #!/usr/bin/env python3 """Integration test for module detection at the mast""" import os import sys parent_dir = os.path.dirname(os.path.abspath(__file__)) gparent_dir = os.path.dirname(parent_dir) ggparent_dir = os.path.dirname(gparent_dir) gggparent_dir = os.path.dirn...
2.21875
2
kornia/contrib/__init__.py
lyhyl/kornia
0
12779012
<reponame>lyhyl/kornia from kornia.contrib.connected_components import connected_components from kornia.contrib.extract_patches import extract_tensor_patches, ExtractTensorPatches __all__ = ["connected_components", "extract_tensor_patches", "ExtractTensorPatches"]
1.351563
1
machine-learning/diabetes.py
m-01101101/product-analytics
0
12779013
""" The PIMA Indians dataset obtained from the UCI Machine Learning Repository The goal is to predict whether or not a given female patient will contract diabetes based on features such as BMI, age, and number of pregnancies It is a binary classification problem """ import matplotlib.pyplot as plt import numpy...
3.71875
4
modules/tests/generator.py
ansteh/multivariate
0
12779014
<gh_stars>0 import pandas as ps import numpy as np import os, sys sys.path.append('../../modules/') import generation.normal as generator import generation.nonnormal as nonnormalGenerator import analysis.deviation as deviation from analysis.covariance import cov from analysis.correlation import corr from analysis.mean...
2.453125
2
actions.py
Blubmin/adversarial_tower_defense
0
12779015
<filename>actions.py savedStates = [] def SaveState(actionState): # Find all states matching the given state that are already in the database matchingStates = list(state for state in savedStates if state.boardState == actionState.boardState) bestScore = actionState.score if matchingStates: # For eac...
3.21875
3
Section 4/44_POM/testAll.py
IgorPavlovski84/-Automating-Web-Testing-with-Selenium-and-Python
26
12779016
<gh_stars>10-100 import unittest from selenium import webdriver from page import HomePage from page import AboutPage from locators import CommonPageLocators from locators import AboutPageLocators class TestPyOrgBase(unittest.TestCase): """ TBD """ def setUp(self): chrome_options = webdriver.Chr...
2.53125
3
untitled1.py
moeinderakhshan/workshop_practice
0
12779017
<reponame>moeinderakhshan/workshop_practice # -*- coding: utf-8 -*- """ Created on Wed Mar 31 10:25:16 2021 @author: Derakhshan """ a=3+5 print(a)
1.976563
2
handlingMissingKeys.py
universekavish/pythonTraining
0
12779018
<reponame>universekavish/pythonTraining #handling missing keys in python dictionaries country_code = {'India' : '0091', 'Australia' : '0025', 'Nepal' : '00977'} # 1. Using get() # get(key, def_val) print(country_code.get('India', 'Not Found')) print(country_code.get('Japan', 'Not found')) # 2. Using setdefault() # ...
3.921875
4
cli/src/plz/cli/show_status_operation.py
prodo-ai/plz
29
12779019
import collections from typing import Any, Optional from plz.cli.composition_operation import CompositionOperation, \ create_path_string_prefix from plz.cli.configuration import Configuration from plz.cli.log import log_info from plz.cli.operation import on_exception_reraise ExecutionStatus = collections.namedtup...
2.21875
2
ldap_parser.py
frnde/ldap_errors_fixer
0
12779020
from ldif import LDIFParser class ParseLDIF(LDIFParser): def __init__(self, input_file, processing_object): LDIFParser.__init__(self, input_file) self.processing_object = processing_object def handle(self,dn, entry): self.processing_object.process_entry(dn, entry)
2.359375
2
scrabble/raw_metadata_stats.py
jbkoh/Scrabble
6
12779021
import json import pdb from functools import reduce from collections import OrderedDict, Counter import random import re def replace_num_or_special(word): if re.match('\d+', word): return 'NUMBER' elif re.match('[a-zA-Z]+', word): return word else: return 'SPECIAL' building = 'ebu...
2.84375
3
bot/chat_types/alltypes.py
telegrambotdev/hamilton-bot
0
12779022
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton import psutil async def help(client, msg, args): client.select_lang(msg, "all") await msg.reply(msg.lang["help"]["ok"]) async def start(client, msg, args): client.select_lang(msg, "all") await msg.reply(msg.lang["start"]["ok"]) # ...
2.484375
2
src/services/text_postprocessor/kafka/kafka_producer.py
dam1002/GESPRO_GESTIONVERSIONES
7
12779023
<reponame>dam1002/GESPRO_GESTIONVERSIONES # Copyright (C) 2021 <NAME> <<EMAIL>> # # 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...
2.046875
2
simsapa/assets/ui/memos_browser_window_ui.py
ilius/simsapa
0
12779024
<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'simsapa/assets/ui/memos_browser_window.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you ...
1.828125
2
generating_address.py
ttw225/IOTA_learning
0
12779025
from iota import Iota from iota.crypto.addresses import AddressGenerator seed = b'<KEY>' # generator = AddressGenerator(seed) generator =\ AddressGenerator( seed=seed, security_level=3, ) # Generate a list of addresses: # addresses = generator.get_addresses(index=0, count=5) # NOOO! Document...
3.09375
3
pipeline/medication_stats_logit.py
vincent-octo/risteys
0
12779026
<reponame>vincent-octo/risteys #!/usr/bin/env python3 """ Compute drug scores related to a given endpoint. Usage: python3 medication_stats_logit.py \ <ENDPOINT> \ # FinnGen endpoint for which to compute associated drug scores <PATH_FIRST_EVENTS> \ # Path to the first events...
2.4375
2
examples/optimization/ex5.py
mikelytaev/wave-propagation
15
12779027
<filename>examples/optimization/ex5.py from propagators._utils import * from scipy.interpolate import approximate_taylor_polynomial from scipy.interpolate import pade def pade_propagator_coefs_m(*, pade_order, diff2, k0, dx, spe=False, alpha=0): if spe: def sqrt_1plus(x): return 1 + x / 2 ...
2.46875
2
Django-Blog/blog/forms.py
ArsalanShahid116/Django-Blog-Application
1
12779028
<reponame>ArsalanShahid116/Django-Blog-Application<gh_stars>1-10 from django import forms from .models import Comment, Post from django.contrib.auth import get_user_model class EmailPostForm(forms.Form): name = forms.CharField(max_length=25) email = forms.EmailField() to = forms.EmailField() comments =...
2.296875
2
orion/core/operators/collect_wb_indicators_task.py
orion-search/orion-backend
19
12779029
""" Collects indicators from the World Bank. Currently, we collect indicators from the following URLs: - http://datatopics.worldbank.org/world-development-indicators/themes/economy.html#featured-indicators_1 - http://datatopics.worldbank.org/world-development-indicators/themes/states-and-markets.html#featured-indicator...
2.765625
3
visualise/utilities/camera.py
snake-biscuits/bsp_tool_examples
0
12779030
<gh_stars>0 # TODO: # First-person and Third-person camera need update # to receive information based on character motion # An AI that interprets inputs into realistic camera motion would be cool # Inputs should be typed (Cython) # # FIXED CAMERA with either: # no rotation # scripted rotation (i.e. security camera) # p...
2.515625
3
myia/operations/macro_embed.py
strint/myia
222
12779031
"""Implementation of the 'embed' operation.""" from ..lib import Constant, SymbolicKeyInstance, macro, sensitivity_transform @macro async def embed(info, x): """Return a constant that embeds the identity of the input node.""" typ = sensitivity_transform(await x.get()) key = SymbolicKeyInstance(x.node, ty...
2.203125
2
python/test_vending_machine.py
objarni/VendingMachine-Approval-Kata
3
12779032
<reponame>objarni/VendingMachine-Approval-Kata import pytest from approvaltests import verify from vending_machine import VendingMachine from vending_machine_printer import VendingMachinePrinter @pytest.fixture() def machine(): return VendingMachine() @pytest.fixture def printer(machine): return VendingMac...
2.640625
3
variable_and_data_type/string_demo/multiline_string.py
pysga1996/python-basic-programming
0
12779033
<gh_stars>0 # You can assign a multiline string to a variable by using three quotes: a = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""" print(a) # Or three single quotes: a = '''Lorem ipsum dolor sit amet, consectetur adipiscing elit,...
2.859375
3
api/migrations/0002_auto_20190805_1603.py
damianomiotek/best_transport_Poland
0
12779034
<filename>api/migrations/0002_auto_20190805_1603.py<gh_stars>0 # Generated by Django 2.1.7 on 2019-08-05 14:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AlterField( mo...
1.46875
1
scripts/tldr_analyze_nuggets.py
allenai/scitldr
628
12779035
""" Some analysis of informational content of TLDR-Auth and TLDR-PR """ import os import csv from collections import Counter, defaultdict INFILE = 'tldr_analyze_nuggets/tldr_auth_pr_gold_nuggets_2020-03-31.csv' # Q1: How many nuggets do TLDRs contain? # A: Interesting, both author and PR have nearly identical di...
2.765625
3
SubredditBirthdays/sb.py
voussoir/redd
444
12779036
import argparse import bot3 import datetime import praw3 as praw import random import sqlite3 import string import subprocess import sys import time import tkinter import traceback import types from voussoirkit import betterhelp from voussoirkit import mutables from voussoirkit import operatornotify from voussoirkit i...
2.265625
2
src/CiteSoftLocal.py
tsikes/Frhodo
3
12779037
<gh_stars>1-10 from __future__ import print_function from datetime import datetime #import yaml #assume these are not available. #import semantic_version #assume these are not available. import re import sys import os def eprint(*args, **kwargs):#Print to stderr print(*args, file=sys.stderr, **kwargs) citations_...
2.625
3
src/cleantxt/__main__.py
jemiaymen/cleantxt
0
12779038
from cleantxt import text from tqdm import tqdm import argparse import os def rule(s): try: k, v = map(str, s.split(',')) return k, v except: raise argparse.ArgumentTypeError("Escape Rule must be key,value ") def main(): parser = argparse.ArgumentParser( prog="cleantxt cl...
2.984375
3
Metodos_numericos/MinimosQuadrados/MinimosQuadrados.py
iOsnaaente/Faculdade_ECA-UFSM
0
12779039
<filename>Metodos_numericos/MinimosQuadrados/MinimosQuadrados.py<gh_stars>0 import matplotlib.pyplot as plt from random import randint from sympy import symbols import numpy as np from math import * # Primeiro definimos a variável que será lida f(x) = x x = symbols('x') # Função dos mínimos quadrados def minimos(x,...
3.515625
4
src/model.py
sarveshwar22/BISAG_Weather_Forecasting
0
12779040
import utils as util import tensorflow as tf import numpy as np def forecast_model(series, time,forecastDays): split_time=2555 time_train=time[:split_time] x_train=series[:split_time] split_time_test=3285 time_valid=time[split_time:split_time_test] x_valid=series[split_time:split_time_test] ...
2.546875
3
magpylib/_src/obj_classes/class_BaseExcitations.py
OrtnerMichael/magPyLib
0
12779041
"""BaseHomMag class code DOCSTRINGS V4 READY """ from magpylib._src.input_checks import check_format_input_scalar from magpylib._src.input_checks import check_format_input_vector class BaseHomMag: """provides the magnetization attribute for homogeneously magnetized magnets""" def __init__(self, magnetizatio...
2.640625
3
Python/Buch_ATBS/Teil_2/Kapitel_17_Bildbearbeitung/03_formen_zeichnen/03_formen_zeichnen.py
Apop85/Scripts
0
12779042
<gh_stars>0 # 03_formen_zeichnen.py # In dieser Übung geht es darum Formen zu zeichnen mit der Funktion ImageDraw from PIL import Image, ImageDraw import os os.chdir(os.path.dirname(__file__)) target_file='.\\drawed_image.png' if os.path.exists(target_file): os.remove(target_file) new_image=Image.new('RGBA', (20...
2.671875
3
experimentor/models/experiments/exceptions.py
aquilesC/experimentor
4
12779043
<reponame>aquilesC/experimentor # ############################################################################## # Copyright (c) 2021 <NAME>, Dispertech B.V. # # exceptions.py is part of experimentor # # This file is released under an MIT license. ...
1.601563
2
server/main/views/importer.py
zhwycsz/edd
1
12779044
# coding: utf-8 """ Views handling the legacy import to EDD. """ import json import logging import uuid from django.conf import settings from django.contrib import messages from django.http import HttpResponse, JsonResponse from django.shortcuts import render from django.utils.translation import ugettext as _ from dj...
2.0625
2
Tty except.py
dimagela29/Python-POO
0
12779045
# -*- coding: utf-8 -*- """Try except.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/14WiGGPNcZvzQap4fhgTkWTKv3ybjJnvc """ try: a = "Curso python Orientado a objetos" print(a) except NameError as erro: print('Erro do desenvolvedor, fale co...
2.96875
3
yardstick/vTC/apexlake/tests/api_test.py
alexnemes/yardstick_enc
1
12779046
# Copyright (c) 2015 Intel Research and Development Ireland Ltd. # # 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 app...
1.960938
2
main.py
zThorn/Chip-8-Emulator
0
12779047
import pyglet from emulator import emulator def start(dt): pyglet.clock.schedule_interval(emulator.main, 1/1000) #need this for pyglet def update(dt): if emulator.cpu.opcode != 0x1210: emulator.cpu.cycle() else: pyglet.clock.unschedule(update) pyglet.clock.schedule_once(start, 3) ...
2.96875
3
lightconvpoint/utils/functional.py
valeoai/POCO
13
12779048
<filename>lightconvpoint/utils/functional.py<gh_stars>10-100 import torch def batch_gather(input, dim, index): index_shape = list(index.shape) input_shape = list(input.shape) views = [input.shape[0]] + [ 1 if i != dim else -1 for i in range(1, len(input.shape)) ] expanse = list(input.shap...
2.265625
2
clone/admin.py
gamersdestiny/SB-Admin-clone
0
12779049
from django.contrib import admin import clone.models as mod admin.site.register(mod.lineChart) admin.site.register(mod.donutChart)
1.328125
1
code/traditional/TCA/TCA.py
lw0517/transferlearning
3
12779050
# encoding=utf-8 """ Created on 21:29 2018/11/12 @author: <NAME> """ import numpy as np import scipy.io import scipy.linalg import sklearn.metrics from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split def kernel(ker, X1, X2, gamma): K = None if not ker...
2.5
2