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 |
|---|---|---|---|---|---|---|
kotti/views/util.py | IonicaBizauKitchen/Kotti | 191 | 12765151 | import hashlib
from collections import defaultdict
from datetime import datetime
from urllib.parse import urlencode
from babel.dates import format_date
from babel.dates import format_datetime
from babel.dates import format_time
from babel.numbers import format_currency
from pyramid.decorator import reify
from pyramid.... | 1.820313 | 2 |
IndianNameGenerator/Names.py | bshantherishenoy/indian-name-generator | 0 | 12765152 | import random
#Punjabi
#-----
mainNamePunjabi=["Gagan", "Har", "Bal", "Man", "Nav", "Sukh", "Kush", "Gur", "Karam", "Karan", "Dil", "Dharam", "Param", "Dal", "Jas", "Par", "Dul"]
maleSuffixPunjabi=["jeet", "jyot", "vinder", "preet", "meet"]
femleSuffixPunjabi=["preet", "jeet", "bir"]
unionSuffixPunjabi=ma... | 3.1875 | 3 |
bnn/src/training/characters-gen-binary-weights.py | Siraj-Qazi/BNN-PYNQ | 7 | 12765153 | #BSD 3-Clause License
#=======
#
#Copyright (c) 2017, Xilinx
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#
#* Redistributions of source code must retain the above copyright notice, this
# list o... | 1.078125 | 1 |
magpie/dataset/dataset.py | daemon/magpie | 3 | 12765154 | <gh_stars>1-10
from collections import namedtuple
import enum
import torch.utils.data as data
registry = {}
class DatasetType(enum.Enum):
TRAINING = enum.auto()
VALIDATION = enum.auto()
TEST = enum.auto()
class MagpieDataset(data.Dataset):
def __init_subclass__(cls, name, **kwargs):
reg... | 2.625 | 3 |
newtonnet/train/hooks/__init__.py | THGLab/NewtonNet | 0 | 12765155 | <filename>newtonnet/train/hooks/__init__.py
"""
"""
from newtonnet.train.hooks.visualizers import VizMolVectors3D | 0.984375 | 1 |
option_keyboard/core/networks.py | aditimavalankar/option-keyboard | 13 | 12765156 | <filename>option_keyboard/core/networks.py
import torch.nn as nn
class MlpDiscrete(nn.Module):
def __init__(self, input_dim, output_dim, hidden=[64, 128]):
super(MlpDiscrete, self).__init__()
self.hidden1 = nn.Linear(input_dim, hidden[0])
self.relu = nn.ReLU()
self.hidden2 = nn.L... | 2.75 | 3 |
reasoner/json2f2.py | shiv-io/blawx | 1 | 12765157 | <filename>reasoner/json2f2.py
# Script to Take a JSON object, convert it into a Python structure, and convert the Python structure into Flora-2 code.
# <NAME>
import sys, json, types
def json2flora(key,value,parentname="data",root=False):
retstr = ""
# If this is not a leaf:
if isinstance(value, (list,dict,tupl... | 3.59375 | 4 |
decorators_ex.py | srknbyrm/Python | 0 | 12765158 | def start_end_decorator(func):
def wrapper():
print('start')
func()
print('end')
return wrapper
@start_end_decorator # print_name = start_end_decorator(print_name)
def print_name():
print('serkan')
print_name()
import functools
def sum_of_digits(func):
@functools.wraps(f... | 3.765625 | 4 |
app/main.py | paiv/icfpc2020 | 0 | 12765159 | <reponame>paiv/icfpc2020
#!/usr/bin/env python
import arrival
import requests
import sys
from urllib.parse import urljoin
import logging
logging.basicConfig(level=logging.DEBUG)
class Transport:
def __init__(self, url, api_key=None):
self.url = url
self.api_key = api_key
self.req = reques... | 2.9375 | 3 |
models/Transformers.py | 050644zf/sccl | 0 | 12765160 | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved
Author: <NAME> (<EMAIL>)
Date: 02/26/2021
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
# from transformers import AutoModel, AutoTokenizer
class SCCLBert(nn.Module):
def __init__(self, b... | 2.453125 | 2 |
moogle/profiles/migrations/0003_auto__add_driveprofile.py | nimiq/moogle-project | 4 | 12765161 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DriveProfile'
db.create_table('profiles_driveprofile', (
... | 2.328125 | 2 |
tests/_display/test_line_dot_setting.py | ynsnf/apysc | 16 | 12765162 | from random import randint
from retrying import retry
import apysc as ap
from apysc._display.line_dot_setting import LineDotSetting
class TestLineDotSetting:
@retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000))
def test___init__(self) -> None:
setting: LineDotSetting = LineD... | 2.5625 | 3 |
remote_api.py | PatchPorting/patcher | 2 | 12765163 | """
Copyright (c) 2017 IBM Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub... | 2.375 | 2 |
zoo_torch/examples/pose_estimation_quanteval.py | quic/aimet-model-zoo | 89 | 12765164 | <reponame>quic/aimet-model-zoo
#!/usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2020 of Qualcomm Innovation Center, Inc. All rights reserved.
#
# @@-COPYRIGHT-END-@@
# ============================... | 1.859375 | 2 |
google_analytics/light_gbm_valid_set.py | mathxyz/stock2 | 92 | 12765165 | <reponame>mathxyz/stock2
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn.model_selection import train_test_split
#run
X_train = np.load('X_train.dat')
y_train = np.load('y_train.dat')
X_test = np.load('X_test.dat')
X_train.shape
y_train.shape
X_test.shape
#split off a validation set
X_t... | 2.765625 | 3 |
ems_auth/models.py | Atwinenickson/lendsuphumanresourcemanagement | 36 | 12765166 | <filename>ems_auth/models.py
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth.models import PermissionsMixin
from django.db import models
# Create your models here.
from employees.models import Employee
class UserManager(BaseUserManager):
def create_user(self, ... | 2.359375 | 2 |
splunk_ansible_code-master/backend/update_apps_in_branch.py | jfhucka/Configator | 1 | 12765167 | <reponame>jfhucka/Configator
################################################
#
# This is a python that pulls all the splunk apps from teh git:/splunk_apps repo
#
# This script should be attached to a cron job, if the local repo branch is to be kept up to date.
# Or this script can be executed manaully after t... | 2.140625 | 2 |
examples/txt2unicode/demo_utf8_2_tscii.py | nv-d/open-tamil | 218 | 12765168 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2014 Arulalan.T <<EMAIL>>
# (C) 2015 <NAME>
# This file is part of 'open-tamil/txt2unicode' package examples
#
import sys
sys.path.append("../..")
from tamil.txt2unicode import tscii2unicode, unicode2tscii
tscii = """¾¢ÕÅûÙÅ÷ «ÕǢ ¾¢ÕìÌÈû """
uni_1 = tscii2unico... | 3.203125 | 3 |
APIdata.py | janbrus/px-api-prophet | 0 | 12765169 | """
coding: utf-8
@authour: <NAME>, modified <NAME>
Inspired by:
https://github.com/hmelberg/stats-to-pandas/blob/master/stats_to_pandas/__init__.py
https://github.com/eurostat/prophet
"""
from __future__ import print_function
import pandas as pd
import requests
import ast
from pyjstat import pyjstat
from co... | 2.96875 | 3 |
py/maximum-product-of-word-lengths.py | ckclark/leetcode | 0 | 12765170 | <filename>py/maximum-product-of-word-lengths.py<gh_stars>0
from operator import or_
class Solution(object):
def maxProduct(self, words):
"""
:type words: List[str]
:rtype: int
"""
words = filter(None, words)
if not words:
return 0
words.sort(key=l... | 3.390625 | 3 |
source_ddc/test/unit/test_ddc.py | sansan-inc/econ-source | 26 | 12765171 | import numpy as np
from source_ddc.simulation_tools import simulate
from source_ddc.algorithms import NFXP, NPL, CCP
from source_ddc.probability_tools import StateManager, random_ccp
from test.utils.functional_tools import average_out
n_repetitions = 10
def test_nfxp(simple_transition_matrix):
def utility_fn(th... | 2.265625 | 2 |
examples/concatenate.py | nvllsvm/consumerpool | 6 | 12765172 | <filename>examples/concatenate.py<gh_stars>1-10
from consumers import Pool
def concatenate(letters):
return '-'.join(letters)
with Pool(concatenate, quantity=2) as pool:
for letter in 'abcdef':
pool.put(letter)
print(pool.results)
| 3.125 | 3 |
run.py | t2wan/DSC180A-CheckPoint1 | 1 | 12765173 | <reponame>t2wan/DSC180A-CheckPoint1
#!/usr/bin/env python
import sys
import json
from etl import get_data
def main(targets):
if 'DBLP' in targets:
with open('config/data-params.json') as fh:
data_cfg = json.load(fh)
# make the data target
get_data(data_cfg)
return
if __name__... | 2.109375 | 2 |
bot/utils.py | RehanPlayz/YesBot | 1 | 12765174 | <gh_stars>1-10
#
# YesBot utils.py | Copyright (c) 2020 Mrmagicpie
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
import discord
from discord.ext import commands
from discord.ext.commands import BucketType
import datetime
#
#
# # # # # # # # # #... | 2.484375 | 2 |
hackcollab_project/hosts.py | calixo888/hackcollab | 0 | 12765175 | <reponame>calixo888/hackcollab
from django.conf import settings
from django_hosts import patterns, host
host_patterns = patterns('',
host(r'www', 'hackcollab_app.urls', name='www'),
host(r'solarhacks', 'hackathon.urls', name='solarhacks'),
host(r'testhacks', 'hackathon.urls', name='testhacks'),
host(r'... | 1.46875 | 1 |
co2-calculator.py | vladetaStoj/VehicleEmissionCalculator | 0 | 12765176 | #SAP DevelopmentChallange solution, written by <NAME> (<EMAIL>)
#Version: 01_28082020
#License: MIT
import sys
import argparse
from emissions import VehicleEmissions
#Important note: ArgumentParser converts any "-" to "_"
ap = argparse.ArgumentParser()
ap.add_argument("--distance", "-dist", help = "Total distance tr... | 3.296875 | 3 |
mavsdk/transponder_pb2_grpc.py | PML-UCF/MAVSDK-Python | 0 | 12765177 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import transponder_pb2 as transponder_dot_transponder__pb2
class TransponderServiceStub(object):
"""
Allow users to get ADS-B information
and set ADS-B update rates.
"""
def __init__(self, channel):
"""Constructor... | 2.03125 | 2 |
angular_flask/controllers.py | dgolovan/everblog | 1 | 12765178 | <reponame>dgolovan/everblog
import os
from functools import update_wrapper
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory
from flask import send_file, make_response, abort, current_app
from datetime import timedelta, datetime
from bson.json_util imp... | 2.046875 | 2 |
oslo_middleware/tests/test_http_proxy_to_wsgi.py | mail2nsrajesh/oslo.middleware | 0 | 12765179 | # Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 2.0625 | 2 |
make_const.py | creachadair/curled | 0 | 12765180 | <reponame>creachadair/curled<gh_stars>0
#!/usr/bin/env python
##
## Name: make_const.py
## Purpose: Make the "constants" module.
##
## Copyright (c) 2009-2010 <NAME>, All Rights Reserved.
##
import errno, os, sys
SECTION_COMMENT = {
'CURLcode': 'Return codes from curl_easy_* functions',
'CURLFORMcode': '... | 1.414063 | 1 |
wn/_config.py | fushinari/wn | 0 | 12765181 | <gh_stars>0
"""
Local configuration settings.
"""
from typing import Dict
from pathlib import Path
import toml
from wn import Error
from wn._types import AnyPath
from wn._util import is_url, resources, short_hash
# The directory where downloaded and added data will be stored.
DEFAULT_DATA_DIRECTORY = Path.home() /... | 2.65625 | 3 |
prashpyutil/sum.py | pfarkya/prashpyutil | 0 | 12765182 | <filename>prashpyutil/sum.py
def sumoftwo(a, b):
"""
This is an sumoftwo function to add two number
:param int a: first number to add
:param int b: first number to add
:return: return addition of the integer
:rtype: int
:example:
>>> r = sumoftwo(2, 3)
>>> r
5
"... | 3.78125 | 4 |
experiments/do_umap_plot_interactive.py | chunliangliu2020/de-novo-drug-design | 0 | 12765183 | <gh_stars>0
import os, sys
import argparse
import configparser
import ast
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import time
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import Descriptors
from rdkit.Chem import Lipinski
import altair as ... | 2.09375 | 2 |
ocrb/tba/modules/submodules.py | ecker-lab/object-centric-representation-benchmark | 25 | 12765184 | import numpy as np
import torch
import torch.nn as nn
import functions.submodules as F
def norm_grad(input, max_norm):
if input.requires_grad:
def norm_hook(grad):
N = grad.size(0) # batch number
norm = grad.view(N, -1).norm(p=2, dim=1) + 1e-6
scale = (norm / max_norm... | 2.21875 | 2 |
setup.py | cng-osensa/HelloPy | 0 | 12765185 | <reponame>cng-osensa/HelloPy
#from distutils.core import setup
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
w... | 1.664063 | 2 |
anc2vec/__init__.py | aedera/anc2vec | 2 | 12765186 | <filename>anc2vec/__init__.py
from .main import get_embeddings
from .main import get_go
| 1.046875 | 1 |
app/settings.py | satrio-pamungkas/vrede-backend-fastapi | 0 | 12765187 | <reponame>satrio-pamungkas/vrede-backend-fastapi
from dotenv import load_dotenv
import os
load_dotenv()
SERVER_PORT = int(os.getenv("WEB_PORT"))
DATABASE_USER = os.getenv("DB_USER")
DATABASE_PASSWORD = os.getenv("DB_PASSWORD")
DATABASE_SERVER = os.getenv("DB_SERVER")
DATABASE_PORT = os.getenv("DB_PORT")
DATABASE_N... | 2.046875 | 2 |
listings/extract_features.py | FrederikBoehm/Bachelorarbeit_Text | 0 | 12765188 | model_fn = model_fn_builder(
bert_config=bert_config,
init_checkpoint=init_checkpoint,
layer_indexes=layer_indexes,
use_tpu=False,
use_one_hot_embeddings=False)
# If TPU is not available, this will fall back to normal Estimator on CPU
# or GPU.
estimator = tf.contrib.tpu.TPUEsti... | 2.59375 | 3 |
preprocessing/train_word2vec.py | NikosKolitsas/twitter_sentiment_analysis | 0 | 12765189 | <gh_stars>0
""" local word2vec embedding training """
import os
from gensim.models.word2vec import Word2Vec
DATA_PATH = '../data'
TRAIN = os.path.join(DATA_PATH, 'train')
TEST = os.path.join(DATA_PATH, 'test')
POS_TWEET_FILE = os.path.join(TRAIN, 'train_pos_full_orig.txt')
NEG_TWEET_FILE = os.path.join(TRAIN, 'train_n... | 2.75 | 3 |
sorting_gym/envs/wrappers.py | hardbyte/sorting-gym | 5 | 12765190 | from typing import Union, List
import numpy as np
from gym import spaces, ActionWrapper
from gym.spaces import flatten_space, flatdim, unflatten, flatten
from sorting_gym import DiscreteParametric
def merge_discrete_spaces(input_spaces: List[Union[spaces.Discrete, spaces.Tuple, spaces.MultiBinary]]) -> spaces.Multi... | 2.828125 | 3 |
Aula_6/exercicio1.py | Mateus-Silva11/AulasPython | 0 | 12765191 | <reponame>Mateus-Silva11/AulasPython<gh_stars>0
# Exercico 1 - listas
# Escreva program que leia a nome de 10 alunos
# Armezene os nomes em uma lista
# Imprema a lista
nomes =[]
for i in range(1,11):
nome = [input(f'Informe o {i} Nome')]
nomes.append(nome)
for d in nomes:
print(f' Nomes informados {d}'... | 3.640625 | 4 |
testing/BenchmarkPredictor.py | beratkurar/asar_2018_page_segmentation_competition | 2 | 12765192 | <filename>testing/BenchmarkPredictor.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 21 13:14:50 2017
@author: B
"""
import sys
sys.path.append('/root/PageSegComp/Models/')
import numpy as np
np.random.seed(123)
import argparse
import Models , PageLoadBatches
from keras.callbacks import Mod... | 2.03125 | 2 |
wagtail/images/migrations/0023_merge_20200415_1549.py | sprymix/wagtail | 0 | 12765193 | <reponame>sprymix/wagtail<gh_stars>0
# Generated by Django 2.2.12 on 2020-04-15 06:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0021_image_file_hash'),
('wagtailimages', '0022_auto_20190506_2114'),
]
operations = [
]
| 1.398438 | 1 |
py/solutions/boj/division_plan.py | aid95/algorithm-diary | 0 | 12765194 | <reponame>aid95/algorithm-diary
import heapq
import sys
rl = sys.stdin.readline
root = []
rank = []
def find(x: int) -> int:
if x == root[x]:
return x
root[x] = find(root[x])
return root[x]
def union(x: int, y: int):
_x = find(x)
_y = find(y)
if _x != _y:
if rank[_x] > rank... | 3.15625 | 3 |
TwoPointerSW/ProgrammerString.py | PK-100/Competitive_Programming | 70 | 12765195 | """
We consider a string programmer string if some subset of its letters can be rearranged to form the word programmer.
They are anagrams.
Given a long string determine the number of indices within the string that are in between two programmer strings.
The character 'x' inside an anagram are considered redundant and no... | 4.21875 | 4 |
pipeline.py | ishipachev/UdacitySDCND-CarND-Vehicle-Detection-P5 | 0 | 12765196 | # import multiply_detections
from hog_window_search import find_cars
from heat import apply_heat
import pickle
import cv2
import glob
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.image as mpimg
dist_pickle = pickle.load(open("output/svc_model.p", "rb"))
# get attributes of our svc object
svc ... | 2.3125 | 2 |
tests/test_deprecated_trie_class.py | Bhargavasomu/py-trie | 0 | 12765197 | <reponame>Bhargavasomu/py-trie
import pytest
from trie import Trie
def test_deprecated_trie():
with pytest.warns(DeprecationWarning):
trie = Trie(db={})
trie[b'foo'] = b'bar'
assert b'foo' in trie
assert trie[b'foo'] == b'bar'
| 2.390625 | 2 |
src/accounts/models/__init__.py | earth-emoji/dennea | 0 | 12765198 | from .customer import *
from .vendor import *
from .driver import * | 1.109375 | 1 |
arrow/commands/cmd_remote.py | trstickland/python-apollo | 5 | 12765199 | import click
from arrow.commands.remote.add_organism import cli as add_organism
from arrow.commands.remote.add_track import cli as add_track
from arrow.commands.remote.delete_organism import cli as delete_organism
from arrow.commands.remote.delete_track import cli as delete_track
from arrow.commands.remote.update_organ... | 1.539063 | 2 |
tests/integration/cmor/_fixes/cmip6/test_access_esm1_5.py | markelg/ESMValCore | 26 | 12765200 | """Tests for the fixes of ACCESS-ESM1-5."""
import unittest.mock
import iris
import numpy as np
import pytest
from esmvalcore.cmor._fixes.cmip6.access_esm1_5 import Cl, Cli, Clw, Hus, Zg
from esmvalcore.cmor._fixes.common import ClFixHybridHeightCoord
from esmvalcore.cmor.fix import Fix
from esmvalcore.cmor.table imp... | 1.695313 | 2 |
gamma/FileSystem.py | jappe999/WebScraper | 1 | 12765201 | <filename>gamma/FileSystem.py
import os, re
def create_dir(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
return True
except Exception as e:
print(e)
return False
def set_data(url, html):
stripped_path = re.sub('^(http://|https://)(www\.... | 2.671875 | 3 |
netezza/pyodbc/operations.py | GuidoE/django-netezza | 0 | 12765202 | <gh_stars>0
try:
from django.db.backends.base.operations import BaseDatabaseOperations
except ImportError:
from django.db.backends import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def quote_name(self, name):
return name # Netezza doesn't seem to like quoted names
| 1.84375 | 2 |
fastestimator/trace/io/csv_logger.py | TortoiseHam/fastestimator | 1 | 12765203 | # Copyright 2019 The FastEstimator Authors. 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 appl... | 2.375 | 2 |
rwanda_dummy_deterministic.py | Data-Linkage/Rwandan_linkage | 0 | 12765204 | <reponame>Data-Linkage/Rwandan_linkage
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 20 14:25:54 2022
@author: collys
"""
" Rwanda synthetic data - deterministic linkage example"
""" Matching vars -
Full_name
First_name
Last_name
Month
Year
Sex
Age
Head_of_household... | 2.296875 | 2 |
spartan/expr/base.py | MaggieQi/spartan | 0 | 12765205 | <reponame>MaggieQi/spartan<filename>spartan/expr/base.py
'''
Defines the base class of all expressions (`Expr`), as
well as common subclasses for collections.
'''
import collections
import weakref
import sys
import traceback
import numpy as np
from ..node import Node, indent
from .. import blob_ctx, node, util
from ... | 2.109375 | 2 |
tests/test_metaclass.py | Lex0ne/trafaret_validator | 8 | 12765206 | from unittest import TestCase
import trafaret as t
from trafaret_validator import TrafaretValidator
class ValidatorForTest(TrafaretValidator):
t_value = t.Int()
value = 5
class ValidatorForTest2(ValidatorForTest):
test = t.String()
class TestMetaclass(TestCase):
def test_metaclass(self):
... | 3.21875 | 3 |
MavenScrapy/MavenScrapy/settings.py | wjcIvan/oschinaLearning | 1 | 12765207 | # -*- coding: utf-8 -*-
# Scrapy settings for MavenScrapy project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/t... | 1.429688 | 1 |
conda.recipe/build_and_upload_conda_package.py | xinbinhuang/featuretools | 1 | 12765208 | <gh_stars>1-10
import subprocess
def build_docker_img(img_id, no_cache=False):
build_cmd = ["docker", "build"]
if no_cache:
build_cmd.append("--no-cache")
build_cmd.extend(["-t", img_id, "."])
# remove so we can catch an error more easily
# in the case where the build command fails
s... | 2.578125 | 3 |
CodeForces/A2OJ Ladder/demo5.py | dimitrov-dimitar/competitive-programming | 0 | 12765209 | <filename>CodeForces/A2OJ Ladder/demo5.py
for i in range(100000):
print(i)
| 1.828125 | 2 |
deeptools/plotPCA.py | gartician/deepTools | 351 | 12765210 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import cm # noqa: F401
from deeptools.correlation import Correlation
from deeptools.... | 2.25 | 2 |
barbucket/contracts.py | ajmal017/barbucket | 1 | 12765211 | import sqlite3
import time
from bs4 import BeautifulSoup
from numpy.core import numeric
import requests
import logging
import enlighten
from barbucket.database import DatabaseConnector
from barbucket.tools import GracefulExiter
class ContractsDatabase():
def __init__(self):
pass
def create_contrac... | 2.703125 | 3 |
src/python/WMCore/WMBS/MySQL/Subscriptions/MarkFinishedSubscriptions.py | khurtado/WMCore | 21 | 12765212 | <filename>src/python/WMCore/WMBS/MySQL/Subscriptions/MarkFinishedSubscriptions.py<gh_stars>10-100
#!/usr/bin/env python
"""
_MarkFinishedSubscriptions_
MySQL implementation of Subscriptions.MarkFinishedSubscriptions
Created on Aug 29, 2012
@author: dballest
"""
from time import time
from WMCore.Database.DBFormatte... | 2.5 | 2 |
funded_stat.py | far-from-normal/Kiva-Insight | 2 | 12765213 | import pandas as pd
import numpy as np
from pathlib import Path
from data_params import Data
from data_utils import (
preprocess_train_df,
fit_stats,
transform_stats,
save_transformed_stats,
)
def summarize_stats(csv_name, dir_to_data, stat_name_select):
path_to_input_df = Path(dir_to_data, csv... | 2.90625 | 3 |
uol_os_reports.py | LCBRU/reporter | 0 | 12765214 | <gh_stars>0
#!/usr/bin/env python3
import reporter.uol_os_reports
from runner import run
run()
| 0.996094 | 1 |
OPMS_v3-dev3.1/apps/online_management/models.py | litiian/asyncstudy | 0 | 12765215 | <gh_stars>0
from django.db import models
from users.models import UserProfile
from host_management.models import DomainNameResolveInfo, ProjectInfo
######################################
# 故障标签表
######################################
class TroubleTag(models.Model):
name = models.CharField(verbose_name='分类名称', max... | 2 | 2 |
Users/forms.py | Fowerus/drf-crm | 3 | 12765216 | from django import forms
from .models import User
class MUserForm(forms.ModelForm):
class Meta:
model = User
fields = ['id', 'surname', 'first_name',
'second_name', 'email', 'phone', 'address']
| 2.1875 | 2 |
individual/carshop/apps.py | PavelBelka/django-2-individual | 0 | 12765217 | from django.apps import AppConfig
class CarshopConfig(AppConfig):
name = 'carshop'
| 1.164063 | 1 |
algorithms/LSBMR.py | FaiZaman/Steganograph-app-y | 0 | 12765218 | <filename>algorithms/LSBMR.py
"""
Least Significant Bit Matching Revisited embedding & extraction algorithm
Embeds two message bits in a two-pixel block
The first bit is embedded in the LSB of the first pixel
The second bit is embedded in the output of a binary function f on both pixels
"""
import math
import random
f... | 2.96875 | 3 |
conans/test/conan_v2/conanfile/test_environment.py | matthiasng/conan | 6,205 | 12765219 | <gh_stars>1000+
import textwrap
from conans.client.tools.env import _environment_add
from conans.test.utils.conan_v2_tests import ConanV2ModeTestCase
class CollectLibsTestCase(ConanV2ModeTestCase):
def test_conan_username(self):
t = self.get_client()
conanfile = textwrap.dedent("""
f... | 2.4375 | 2 |
tests/agents_tests/test_dqn.py | WhenTheyCry96/chainerrl | 2 | 12765220 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
from builtins import * # NOQA
standard_library.install_aliases() # NOQA
import unittest
from chainer import testing
import numpy as ... | 2.0625 | 2 |
dataset_generator.py | lolporer/anomaly_generator | 1 | 12765221 | import csv
import os
# execfile("C:\\Users\\YONI\\Documents\\Projects\\degree\\attack detection methods\\anomaly_generator\\dataset_generator.py")
ROW_NUM = 100
path = "C:\\Users\\YONI\\Documents\\anomally_detector\\data_sets\\example\\"
users_num = 100
features_num = 20
directory = "data_sets\\"
if not os.path.ex... | 2.609375 | 3 |
watchbot_progress/utils.py | mapbox/watchbot-progress-py | 1 | 12765222 | <reponame>mapbox/watchbot-progress-py
import json
from boto3.session import Session as boto3_session
def chunker(iterable, n):
"""
Chop list in smaller lists
"""
for i in range(0, len(iterable), n):
yield iterable[i:i + n]
def aws_send_message(message, topic, subject=None, client=None):
... | 2.484375 | 2 |
snake/utilities.py | owenjaques/kuhmilch | 0 | 12765223 | <reponame>owenjaques/kuhmilch
import json
from enum import Enum
import numpy as np
# TODO: create did collide with self function
# TODO: create did collide with wall function
# TODO: create did kill other snake function
# TODO: create did eat food function
# TODO: move this to a seperate 'constants' file
FREE = 0
FOO... | 3.21875 | 3 |
mmdet3d/models/model_utils/__init__.py | wangguojun2018/CenterNet3d | 91 | 12765224 | from .vote_module import VoteModule
from .deform_conv_layers import DeformConvBlock,ModulatedDeformConvBlock
__all__ = ['VoteModule','DeformConvBlock','ModulatedDeformConvBlock']
| 1.125 | 1 |
tests/theia_automation_lsp/lib/file_explorer.py | grianbrcom/che-che4z-lsp-for-cobol | 0 | 12765225 | # Copyright (c) 2020 Broadcom.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0... | 1.773438 | 2 |
hackerearth/Algorithms/Roy and Tiles/solution.py | ATrain951/01.python-com_Qproject | 4 | 12765226 | <reponame>ATrain951/01.python-com_Qproject
"""
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
... | 2.765625 | 3 |
models.py | YongWookHa/swin-transformer-ocr | 43 | 12765227 | import torch
import random
import pytorch_lightning as pl
from x_transformers import *
from x_transformers.autoregressive_wrapper import *
from timm.models.swin_transformer import SwinTransformer
import utils
class SwinTransformerOCR(pl.LightningModule):
def __init__(self, cfg, tokenizer):
super().__ini... | 2 | 2 |
app.py | davidguzmanr/quickdraw-app | 0 | 12765228 | import streamlit as st
from streamlit_drawable_canvas import st_canvas
from PIL import Image
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.transforms as transforms
import json
# Specify canvas parameters in application
stroke_width = st.sidebar.slider(
label='Stroke width:',... | 2.765625 | 3 |
encoder_decoder/dtypes_encode_decode.py | UMass-Rescue/encoder_decoder | 0 | 12765229 | import numpy as np
def float_ndarray_to_dict(arr):
return np_arr_to_dict(arr)
def dict_to_float_ndarray(string):
return dict_to_np_arr(string)
def identity(e):
return e
def float_to_string(num):
return str(num)
def string_to_float(string):
return float(string)
def np_arr_to_dict(arr):
retu... | 3.0625 | 3 |
plugins/__init__.py | SeaSeaEm/SpueBox | 9 | 12765230 | <reponame>SeaSeaEm/SpueBox<filename>plugins/__init__.py
from .administrative import AdministrativePlugin
from .musicplayer import MusicPlayerPlugin
from .tag import TagPlugin
from .randomgame import RandomGamePlugin
| 1.203125 | 1 |
zerver/webhooks/gosquared/view.py | acguglielmo/zulip | 1 | 12765231 | from typing import Any, Dict, Optional
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_error, json_success
from zer... | 2.0625 | 2 |
tests/test_devopsProjectTest.py | mitchdenny/azure-devops-cli-extension | 0 | 12765232 | <gh_stars>0
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------... | 2.109375 | 2 |
src/asm/cms/cms.py | ctheune/assembly-cms | 0 | 12765233 | import z3c.baseregistry.baseregistry
import asm.cms.page
import grok
import zope.component
import zope.interface
import zope.publisher.browser
import zope.publisher.interfaces.browser
import zope.intid.interfaces
class CMS(grok.Application, asm.cms.page.Page):
zope.interface.implements(asm.cms.interfaces.ICMS)
... | 1.578125 | 2 |
preserialize/utils.py | xzzy/django-preserialize | 23 | 12765234 | <filename>preserialize/utils.py
import collections
from django.db import models
from django.db.models.fields import Field
from django.db.models import FieldDoesNotExist
PSEUDO_SELECTORS = (':all', ':pk', ':local', ':related')
DEFAULT_SELECTORS = (':pk', ':local')
def convert_to_camel(s):
if '_' not in s:
... | 2.21875 | 2 |
openbook_invitations/migrations/0002_auto_20190101_1413.py | TamaraAbells/okuna-api | 164 | 12765235 | <gh_stars>100-1000
# Generated by Django 2.1.4 on 2019-01-01 13:13
from django.conf import settings
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(sett... | 1.984375 | 2 |
python/lvmnps/switch/dli/powerswitch.py | wasndas/lvmnps | 0 | 12765236 | # -*- coding: utf-8 -*-
#
# @Author: <NAME> (<EMAIL>)
# @Date: 2021-06-24
# @Filename: lvmnps/switch/iboot/powerswitch.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
import datetime
from sdsstools.logger import SDSSLogger
from lvmnps.switch.dli.lvmpower import PowerSwitch as DliPowerSw... | 1.875 | 2 |
slurm/merge_analysis.py | oxfordni/storm-analysis | 0 | 12765237 | #!/usr/bin/env python
"""
Merges the intermediate localization files into a single
localization file.
Hazen 08/17
"""
import glob
import os
from xml.etree import ElementTree
import storm_analysis.sa_library.readinsight3 as readinsight3
import storm_analysis.sa_library.writeinsight3 as writeinsight3
def mergeAnalys... | 2.328125 | 2 |
joatu/settings/prod.py | moileretour/joatu | 1 | 12765238 | from joatu.settings.base import *
DEBUG = False
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middle... | 1.3125 | 1 |
examples/basic-usage/lambda/main.py | JousP/terraform-aws-lambda-function | 0 | 12765239 | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):
logger.info("Hello World!")
| 2.53125 | 3 |
storage/views.py | bopopescu/storyboard | 0 | 12765240 | #!/usr/bin/env python
# encoding: utf-8
"""
views.py
Created by <NAME> on 2012-04-02.
Copyright (c) 2012 Close To U. All rights reserved.
"""
import datetime
import logging
import hashlib
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import Request... | 1.914063 | 2 |
quickdraw/create_dataset.py | davidguzmanr/quickdraw-app | 0 | 12765241 | from quickdraw import QuickDrawDataGroup
from tqdm import tqdm
import os
def main():
"""
Download the images and create the necessary directories to store them.
Notes
-----
- See https://pytorch.org/vision/stable/datasets.html#torchvision.datasets.ImageFolder to see
how images must be arrang... | 3.1875 | 3 |
evcouplings/utils/tracker/sql.py | mrunalimanj/EVcouplings | 117 | 12765242 | <reponame>mrunalimanj/EVcouplings
"""
SQL-based result tracker (cannot store actual results, only status).
Using this tracker requires installation of the sqlalchemy package.
Regarding using models from different sources in Flask-SQLAlchemy:
https://stackoverflow.com/questions/28789063/associate-external-class-model-w... | 2.171875 | 2 |
Surviving/main.py | jungwoohan72/DGN_pytorch | 48 | 12765243 | import math, random, copy
import numpy as np
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
import torch.nn.functional as F
from DGN import DGN
from buffer import ReplayBuffer
from surviving import Surviving
from co... | 1.929688 | 2 |
Desafios/desafio55.py | gustavodoamaral/115_Desafios_Python | 1 | 12765244 | <reponame>gustavodoamaral/115_Desafios_Python
pesos = []
for p in range(1,6):
peso = int(input("Digite o peso: "))
pesos.append(peso)
print("o menor peso é {} e o menor peso é {}".format(min(pesos), max(pesos))) | 4 | 4 |
stock_activities/migrations/0015_alter_stockactivity_activity_type_id.py | ericpesto/Archeon-Django-REST-API | 1 | 12765245 | <reponame>ericpesto/Archeon-Django-REST-API
# Generated by Django 3.2.4 on 2021-06-05 22:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('activity_definitions', '0008_alter_activitydefinition_activity_type_id'),
... | 1.546875 | 2 |
Transcribe-Comprehend/util/xer_py3.py | Napkin-DL/my-aws-example | 0 | 12765246 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import unicode_literals # at top of module
import argparse
import logging
import sys
logging.basicConfig(
format='%(levelname)s(%(filename)s:%(lineno)d): %(message)s')
def levenshtein(u, v):
prev = None
curr = [0] + list(range(1, len(v)... | 2.890625 | 3 |
pymtl3/stdlib/test_utils/test_srcs.py | kevinyuan/pymtl3 | 0 | 12765247 | """
========================================================================
Test sources
========================================================================
Test sources with CL or RTL interfaces.
Author : <NAME>
Date : Mar 11, 2019
"""
from collections import deque
from pymtl3 import *
from pymtl3.stdlib.ifc... | 2.21875 | 2 |
gym_wrapper/jsbsimgymenvironmentwrapper.py | lauritowal/JSBSim_gym_wrapper | 1 | 12765248 | import gym
from typing import List, Tuple, Dict
import numpy as np
from gym import spaces
from core.simulation import Simulation
from service import global_constants
class JsbsimGymEnvironmentWrapper(gym.Env):
"""Custom Environment that follows gym interface"""
metadata = {'render.modes': ['human']}
def __... | 2.25 | 2 |
YouIsAMazeMe/game/movingSprite.py | jakeard/YouIsAMazeMe | 0 | 12765249 | <reponame>jakeard/YouIsAMazeMe<filename>YouIsAMazeMe/game/movingSprite.py<gh_stars>0
# A subclass of arcade.sprite, and a superclass of every moving sprite.
import arcade
import game.constants as constants
class MovingSprite(arcade.Sprite):
"""
A super class that keeps track of all moving sprites
locatio... | 3.5625 | 4 |
lang/py/pylib/code/xml/etree/ElementTree/ElementTree_entity_references.py | ch1huizong/learning | 13 | 12765250 | <reponame>ch1huizong/learning<filename>lang/py/pylib/code/xml/etree/ElementTree/ElementTree_entity_references.py
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 <NAME>. All rights reserved.
#
"""Dump the OPML in plain text
"""
#end_pymotw_header
from xml.etree import ElementTree
with open('data.xml', ... | 2.546875 | 3 |