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 |
|---|---|---|---|---|---|---|
agents/imitation/network.py | kadn/carla-imitation | 0 | 12763751 | import numpy as np
import tensorflow as tf
def weight_ones(shape, name):
initial = tf.constant(1.0, shape=shape, name=name)
return tf.Variable(initial)
def weight_xavi_init(shape, name):
initial = tf.get_variable(name=name, shape=shape,
initializer=tf.contrib.layers.xavier_initializer())
... | 2.84375 | 3 |
tools/frontend/alpha/utils/logging.py | Ren-Research/maestro | 0 | 12763752 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import atexit
import builtins
import decimal
import functools
import logging
import os
import sys
from .comm import is_master_process as is_master_proc
def _suppress_print():
"""
Suppresses printing from the current process.
"""
d... | 2.34375 | 2 |
auditwheel/policy/__init__.py | andreysmelter/auditwheel | 0 | 12763753 | <reponame>andreysmelter/auditwheel
import sys
import json
import platform as _platform_module
from typing import Optional
from os.path import join, dirname, abspath
import logging
logger = logging.getLogger(__name__)
_sys_map = {'linux2': 'linux',
'linux': 'linux',
'darwin': 'osx',
... | 2.375 | 2 |
src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pacman/model/abstract_classes/virtual_partitioned_vertex.py | Roboy/LSM_SpiNNaker_MyoArm | 2 | 12763754 | <filename>src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pacman/model/abstract_classes/virtual_partitioned_vertex.py
from pacman.model.partitioned_graph.partitioned_vertex import PartitionedVertex
from pacman.model.constraints.placer_constraints\
.placer_chip_and_core_constraint import PlacerChipAndCoreCons... | 2.421875 | 2 |
Functions/saral_function.py | Ena-Sharma/Meraki_Solution | 0 | 12763755 | <gh_stars>0
def ask_question():
print("Who is the founder of Facebook?")
option=["<NAME>","<NAME>","<NAME>","<NAME>"]
for i in option:
print(i)
ask_question()
i=0
while i<100:
ask_question()
i+=1
def say_hello(name):
print ("Hello ", name)
print ("Aap kaise ho?")
say_hello("jai")
def add_number... | 3.6875 | 4 |
migrations/versions/360581181dc_.py | LandRegistry/system-of-record | 0 | 12763756 | <gh_stars>0
"""empty message
Revision ID: 360581181dc
Revises: <KEY>
Create Date: 2015-03-21 11:22:30.887740
"""
# revision identifiers, used by Alembic.
revision = '360581181dc'
down_revision = '18aa913e6bb'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("DROP INDEX sor_idx")
op... | 1.492188 | 1 |
jacket/db/storage/sqlalchemy/migrate_repo/versions/066_add_allocated_id_column_to_reservations.py | bopopescu/jacket | 0 | 12763757 | # 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, software
# d... | 1.9375 | 2 |
source/funwithflags/entities/auth.py | zywangzy/fun_with_flags | 0 | 12763758 | """Module for authentication utilities."""
import bcrypt
def hash_password_with_salt(password: str, salt: bytes) -> bytes:
"""Hash a password string with a salt bytes."""
return bcrypt.hashpw(bytes(password.encode()), salt)
def generate_salt_hash_password(password: str) -> (bytes, bytes):
"""Hash a pass... | 3.671875 | 4 |
src/python/spaCy2JSON.py | aarushiibisht/JSON-NLP | 24 | 12763759 | <reponame>aarushiibisht/JSON-NLP
#!/usr/bin/env python3
from collections import Counter
import spacy
import json
import datetime
# nlp = spacy.load('en_core_web_lg')
nlp = spacy.load('en')
def process(text):
doc = nlp(text)
j = {
"conformsTo": 0.1,
'source': 'SpaCy {}'.format(spacy.__version... | 2.515625 | 3 |
utils/logger.py | YuLvS/L2PIPS | 3 | 12763760 | import os
import sys
from .util import get_timestamp
# print to file and std_out simultaneously
class PrintLogger(object):
def __init__(self, log_path):
self.terminal = sys.stdout
self.log = open(os.path.join(log_path, 'output.txt'), 'a')
def write(self, message):
self.t... | 2.5625 | 3 |
profileinstaller/integration-tests/testapp/cli/repackage.py | chao2zhang/androidx | 2 | 12763761 | <filename>profileinstaller/integration-tests/testapp/cli/repackage.py<gh_stars>1-10
#!/usr/bin/env python3
import argparse
import os
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
from zipfile import ZipFile
# CHANGEME:
# PATH_TO_APKSIGNER = '/Users/lelandr/Library/Android/sdk/bui... | 2.28125 | 2 |
groupdocsclassificationcloud/__init__.py | groupdocs-classification-cloud/groupdocs-classification-cloud-python | 3 | 12763762 | <reponame>groupdocs-classification-cloud/groupdocs-classification-cloud-python
# coding: utf-8
# flake8: noqa
from __future__ import absolute_import
# import apis into sdk package
from groupdocsclassificationcloud.apis.classification_api import ClassificationApi
# import ApiClient
from groupdocsclassificationcloud.... | 1.25 | 1 |
containers/AVLTree.py | Tonnpo/csci-046 | 0 | 12763763 | <reponame>Tonnpo/csci-046
from containers.BinaryTree import BinaryTree, Node
from containers.BST import BST
from copy import copy
class AVLTree(BST):
'''
FIXME:
AVLTree is currently not a subclass of BST.
You should make the necessary changes in the class declaration line above
and in the construc... | 2.984375 | 3 |
catalog_update_product.py | cognitivefashion/cf-sdk-python | 9 | 12763764 | #------------------------------------------------------------------------------
# Update product in a catalog.
# PUT /v1/catalog/{catalog_name}/products/{id}
#------------------------------------------------------------------------------
import os
import json
import requests
from urlparse import urljoin
from pprint... | 2.453125 | 2 |
2020/Day_06/part1.py | Adilius/adventofcode | 2 | 12763765 | input_file = open("input.txt","r")
lines = input_file.readlines()
count = 0
answers = set()
for line in lines:
if line == "\n":
count += len(answers)
print(answers)
answers.clear()
for character in line:
#print(character)
if character != "\n":
answers.add(cha... | 3.625 | 4 |
unet/unet.py | mvWellman/OCTseg | 3 | 12763766 | # Copyright (C) 2019 Harvard University. All Rights Reserved. Unauthorized
# copying of this file, via any medium is strictly prohibited Proprietary and
# confidential
# Developed by <NAME> <<EMAIL>>,
# <<EMAIL>>.
# ==================================================================... | 2.375 | 2 |
gbe/email/forms/adhoc_email_form.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 1 | 12763767 | from django.forms import (
CharField,
EmailField,
Form,
MultipleChoiceField,
Textarea,
TextInput,
)
from django.forms.widgets import CheckboxSelectMultiple
from django.utils.html import strip_tags
class AdHocEmailForm(Form):
use_required_attribute = False
required_css_class = 'required... | 2.171875 | 2 |
src/vnsw/agent/gdb/agent_ksync.py | jnpr-pranav/contrail-controller | 37 | 12763768 | <reponame>jnpr-pranav/contrail-controller
from __future__ import print_function
#
# Copyright (c) 2016 Juniper Networks. All rights reserved.
#
# agent_ksync.py
#
# gdb macros to dump the vrouter agent KSync object/entries
from builtins import next
from builtins import str
import gdb
from libstdcxx.v6.printers imp... | 2.171875 | 2 |
day15/tests.py | andrewyang96/AdventOfCode2017 | 0 | 12763769 | from solution import final_count
from solution import final_count2
assert final_count(65, 8921, 5) == 1
print(final_count(679, 771, 40000000))
assert final_count2(65, 8921, 5000000) == 309
print(final_count2(679, 771, 5000000))
| 2.0625 | 2 |
swashbot/cmds/current.py | almonds0166/swashbot | 0 | 12763770 |
import discord
INF = None
async def command(client, param, ctx):
"""
Syntax:
~current
Description:
Get it? Current? Haaa
Explicitly tells users how Swashbot is working to swash in the channel
"""
cid = ctx.channel.id
e = discord.Embed(
title="Current settings for this chan... | 2.6875 | 3 |
servicemon/tests/data/user_plugin_dir/cannot_make_reader_instance.py | tomdonaldson/servicemon | 1 | 12763771 | <reponame>tomdonaldson/servicemon
from servicemon.plugin_support import AbstractResultWriter
class CannotInstantiate(AbstractResultWriter, plugin_name='cannot_make_reader_instance',
description="A writer in the user's plug-in dir that cannot be instatiated"
" because it... | 2.53125 | 3 |
molar/cli/commands/cmd_install.py | aspuru-guzik-group/molar | 4 | 12763772 | <reponame>aspuru-guzik-group/molar
# std
from datetime import datetime
from distutils.spawn import find_executable
import os
from pathlib import Path
import secrets
import shutil
import stat
import subprocess
from time import sleep
from typing import List, Optional
# external
from alembic import command
import click
f... | 1.890625 | 2 |
helicalc/__init__.py | FMS-Mu2e/helicalc | 0 | 12763773 | # from __future__ import absolute_import
# import os
import git
def get_git_root(path):
git_repo = git.Repo(path, search_parent_directories=True)
git_root = git_repo.git.rev_parse("--show-toplevel")
return git_root
# def get_conda_dir(cfgfile):
# with open(cfgfile) as f:
# directory = f.readli... | 2.09375 | 2 |
elmo.py | Sparkluis5/EmotionalEmojis-PT | 0 | 12763774 | <filename>elmo.py
import string
import tensorflow_hub as hub
import tensorflow as tf
import numpy as np
import scipy
import model_definitions
from tqdm import tqdm
import pickle
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
... | 2.859375 | 3 |
test/test_segmentation.py | noah80/tsam | 0 | 12763775 | import os
import time
import pandas as pd
import numpy as np
import tsam.timeseriesaggregation as tsam
def test_segmentation():
raw = pd.read_csv(os.path.join(os.path.dirname(__file__),'..','examples','testdata.csv'), index_col = 0)
orig_raw = pd.read_csv(os.path.join(os.path.dirname(__file__),'..','exam... | 2.359375 | 2 |
build_migrator/generators/_cmake/cmake_cmd.py | alexsharoff/BuildMigrator | 17 | 12763776 | <reponame>alexsharoff/BuildMigrator
from build_migrator.common.algorithm import flatten_list
from build_migrator.modules import Generator
command_tmpl = """
COMMAND
${{CMAKE_COMMAND}} -E env{params}
{command}"""
cmd_tmpl = """
add_custom_command(OUTPUT {output}{command}{depends}{working_dir}
... | 2.25 | 2 |
login.py | 19930308/test01 | 0 | 12763777 | def fn():
num1=1
num3=20
sum=num1+num2
print(sum)
num=10
def school():
students=1000
classes=12
avg=students/classes
return avg
num1=school()
if num1>500:
print('人数很好')
| 3.5625 | 4 |
iris_sdk/models/data/lidb_tn_group.py | NumberAI/python-bandwidth-iris | 2 | 12763778 | #!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.maps.lidb_tn_group import LidbTnGroupMap
from iris_sdk.models.data.telephone_number_list import TelephoneNumberList
class LidbTnGroupData(LidbTnGroupMap, BaseData):
def __init__(self):
self.telephone_numbers = T... | 2.265625 | 2 |
src/util/nowcasts_table.py | dfarrow0/nowcast | 3 | 12763779 | """
===============
=== Purpose ===
===============
A simple wrapper for the `nowcasts` table in the Delphi database.
=======================
=== Data Dictionary ===
=======================
Nowcasts (value and standard deviation) are stored in the `nowcasts` table.
+----------+-------------+------+-----+---------+-... | 1.890625 | 2 |
codes/test_incomplete_sim.py | IllusoryTime/Image-Based-CFD-Simulation-Using-Deep-Learning | 16 | 12763780 | <gh_stars>10-100
"""
Despite of deleting all incomplete simulation by delete_all_unnecessary.py there are still some incomplete simulations contains in VTK folder.
This scripts find all those directory and then delete them manually.
"""
import os
from tqdm import tqdm
directory_list = next(os.walk('simulation_data'))[... | 1.921875 | 2 |
perfdump/html.py | etscrivner/nose-perfdump | 1 | 12763781 | # This file is part of nose-perftest.
#
# Copyright (c) 2012, <NAME> and AUTHORS
# 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 copyrigh... | 1.382813 | 1 |
src/bxcommon/network/socket_connection_protocol.py | dolphinridercrypto/bxcommon | 12 | 12763782 | import time
from asyncio import BufferedProtocol
from typing import Optional, TYPE_CHECKING
from bxcommon.network.abstract_socket_connection_protocol import AbstractSocketConnectionProtocol
from bxcommon.network.ip_endpoint import IpEndpoint
from bxutils import logging
from bxutils.logging import LogRecordType
if TYP... | 2.296875 | 2 |
src/gui.py | xi-xi/pyMotionViewer | 0 | 12763783 | import pyglet
from pyglet.gl import *
from OpenGL.GLUT import *
class MainWindow(pyglet.window.Window):
def __init__(self, *args, **kargs):
super(MainWindow, self).__init__(*args, **kargs)
def on_draw(self):
# super(MainWindow, self).on_draw()
# self.clear()
glClear(GL_COLOR_B... | 2.578125 | 3 |
cedm/policy/SummaryActionMaster.py | Ratnesh-Rai/Pydial-Personalisation | 3 | 12763784 | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2018
# Cambridge University Engineering Department Dialogue Systems Grou... | 1.648438 | 2 |
__init__.py | brendasalenave/NRCLex | 29 | 12763785 | <filename>__init__.py
import os
__version__ = '1.5.0'
__license__ = 'MIT'
__author__ = 'metalcorebear'
name = "NRCLex"
PACKAGE_DIR = os.path.dirname(os.path.abspath(__file__))
| 1.296875 | 1 |
src/shopping_cart/migrations/0002_auto_20180531_0944.py | ciphertz/final | 0 | 12763786 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-05-31 09:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shopping_cart', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | 1.40625 | 1 |
setup.py | memcachier/django-ascii | 1 | 12763787 | <reponame>memcachier/django-ascii<filename>setup.py
from setuptools import setup, find_packages
from memcachier_django import __version__
setup(
name = 'memcachier-django-ascii',
version = __version__,
description = 'Django cache backend supporting MemCachier service',
long_description = open('README.... | 1.320313 | 1 |
2h Seira Askisewn/ex2/python/doomsday.py | danchris/pl1-ntua | 0 | 12763788 | <reponame>danchris/pl1-ntua<filename>2h Seira Askisewn/ex2/python/doomsday.py
#!/usr/bin/env python3
import sys
import os
## Global defines
N , M = 1,1
myMap = [['X' for x in range(1002)] for y in range(1002)]
def printMap ():
global myMap, N, M
for i in range(1,N):
for k in range(1,M):
... | 3.46875 | 3 |
analytics/analytics/analytic_types/segment.py | jonyrock-back/hastic-server | 0 | 12763789 | <filename>analytics/analytics/analytic_types/segment.py
from typing import Optional
import utils.meta
@utils.meta.JSONClass
class Segment:
'''
Used for segment manipulation instead of { 'from': ..., 'to': ... } dict
'''
def __init__(
self,
from_timestamp: int,
to_timestamp: in... | 2.375 | 2 |
Python/Account.py | hiddenworlds225/School-code | 0 | 12763790 | class BankAccount:
def __init__(self):
self.accountNum = 0
self.accountOwner = ""
self.accountBalance = 0.00
def ModifyAccount(self, id, name, balance):
self.accountNum = id
self.accountOwner = name
self.accountBalance = balance
account = BankAccount()
acco... | 3.5625 | 4 |
alphatwirl/selection/factories/expand.py | shane-breeze/AlphaTwirl | 0 | 12763791 | <reponame>shane-breeze/AlphaTwirl
# <NAME> <<EMAIL>>
##__________________________________________________________________||
def expand_path_cfg(path_cfg, alias_dict={ }, overriding_kargs={ }):
"""expand a path config
Args:
path_cfg (str, tuple, dict): a config for path
alias_dict (dict): a dic... | 2.375 | 2 |
src/website/search/urls.py | jhk523/news-trend | 1 | 12763792 | <gh_stars>1-10
from django.urls import path
from django.conf.urls import url
from . import views
from search.views import Search, Result
app_name = 'status'
urlpatterns = [
url(r'^$', Search.as_view(), name='index'),
url(r'^result/$', Result.as_view(), name='result')
# path('', Search.as_view(), name='ind... | 1.84375 | 2 |
test.py | l-bdx/iso639 | 6 | 12763793 | import unittest
from iso639 import Lang, iter_langs
from iso639.exceptions import InvalidLanguageValue, DeprecatedLanguageValue
class TestLang(unittest.TestCase):
"""Test the Lang class."""
lang_vals = {tg: set(d.keys()) for tg, d in Lang._data.items()}
lang_vals["changed_to"] = {
d["change_to"] ... | 3 | 3 |
ongoing.py | krbrs/weechat-ongoing | 0 | 12763794 | <reponame>krbrs/weechat-ongoing
# -*- coding: utf-8 -*-
#
# ongoing.py
# Weechat script for automatized downloading of the new releases on XDCC bots.
#
# To enable it copy the file "ongoing.py" to ~/.weechat/python/ directiry and
# execute the command "/python load python/ongoing.py"
#
# The comprehensive information a... | 2.21875 | 2 |
nlptools/news/test/utils.py | hayj/NLPTools | 4 | 12763795 | from systemtools.basics import *
from systemtools.file import *
from systemtools.location import *
from datatools.jsonutils import NDJson
import random
from datastructuretools.processing import *
import copy
def newsCleanerDataTestGen():
for filePath in sortedGlob(execDir(__file__) + "/testdata/newscleaner/*.txt")... | 2.3125 | 2 |
neurolang/datalog/translate_to_named_ra.py | antonia-ms/NeuroLang-1 | 0 | 12763796 | import collections
from operator import contains, eq, not_
from typing import AbstractSet, Callable, Tuple
from ..exceptions import ForbiddenExpressionError, NeuroLangException
from ..expression_walker import (
ExpressionBasicEvaluator,
ReplaceExpressionsByValues,
add_match,
)
from ..expressions import Con... | 2.421875 | 2 |
maximum-depth-of-binary-tree/Solution.6583982.py | rahul-ramadas/leetcode | 0 | 12763797 | <reponame>rahul-ramadas/leetcode
class Solution:
def maxDepth(self, root):
if root is None:
return 0
return 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))
| 3.5 | 4 |
journal/views.py | metadeng/LVTUBEN_CD_TOOLKIL | 0 | 12763798 | <filename>journal/views.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import get_content_type_for_model
from django.contrib.auth.decorators import login_required
from django.core.paginator import Pagina... | 2.0625 | 2 |
zjson/ZJson.py | zoloypzuo/regex_engine | 0 | 12763799 | """
{func} beautified_json and {func} plain_json is simple to use, and it is as same as use {std} json with {func} encodable
"""
from collections import namedtuple, defaultdict, OrderedDict
from json import dumps, load as _load, loads as _loads
from re import sub
from Utils import *
JsonObject = object # indicat... | 3.265625 | 3 |
game/combatant.py | Moguri/prototype-mercury | 2 | 12763800 | import random
from direct.interval import IntervalGlobal as intervals
from .monster import MonsterActor
from . import effects
from . import gamedb
class Combatant:
def __init__(self, monster, parent_node):
gdb = gamedb.get_instance()
self._monster = monster
form = monster.form
se... | 2.484375 | 2 |
pyyaks/context.py | sot/pyyaks | 1 | 12763801 | <reponame>sot/pyyaks<gh_stars>1-10
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function, division, absolute_import
import re
import os
import time
import stat
import pdb
import logging
from six.moves import cPickle as pickle
from copy import deepcopy
import jinja2
imp... | 2.171875 | 2 |
tests/test_camel_to_upper_snake.py | HTPhenotyping/htcondor_file_transfer | 0 | 12763802 | <filename>tests/test_camel_to_upper_snake.py
import pytest
from xfer import camel_to_upper_snake
@pytest.mark.parametrize(
"input, output",
[
("CamelCase", "CAMEL_CASE"),
("AlTeRnAtInG", "AL_TE_RN_AT_IN_G"),
("foobar", "FOOBAR"),
("FOOBAR", "FOOBAR"),
("fooBar", "FOO_B... | 2.703125 | 3 |
nengo/networks/product.py | HugoChateauLaurent/nengo | 0 | 12763803 | <filename>nengo/networks/product.py
import warnings
import numpy as np
import nengo
from nengo.networks.ensemblearray import EnsembleArray
def Product(n_neurons, dimensions, input_magnitude=1., net=None, **kwargs):
"""Computes the element-wise product of two equally sized vectors.
The network used to calcu... | 3.484375 | 3 |
view/progress.py | rbzargon/py_flashcards | 0 | 12763804 | <reponame>rbzargon/py_flashcards
"""
<NAME>
CS521
Due June 30, 2019
Term project
Flashcard application - view for a progress bar
"""
import tkinter as tk
from tkinter import ttk
from utils import pad_children
class ProgressView(ttk.Frame):
'''Class for displaying a progress bar'''
def __init__(self, parent, ... | 3 | 3 |
src/classifier.py | AlfME/proyecto_sin | 0 | 12763805 | """
The pipeline for realizing classification. Consists of a data pre-processing pipeline, a training
module for generating and storing classifiers and finally a procedure to load a defined classifer.
Generic pipeline structure:
1. Tokenization
2. Instance feature cleaning
3. Noise removal
4. Feature Extraction
5. C... | 3.578125 | 4 |
sdk/python/pulumi_proxmox/lxc_container.py | beyondcloud-co/pulumi-proxmox | 0 | 12763806 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 1.398438 | 1 |
ml/logistic/sklogistic.py | ruiyangio/ml-sentiment | 0 | 12763807 | from sklearn.linear_model import LogisticRegression
from modelbase import ModelBase
class SkLogistic(ModelBase):
def __init__(self):
ModelBase.__init__(self)
self.model = LogisticRegression()
| 2.484375 | 2 |
test/test_giftcard.py | AdityaMisra/GiftCardService | 0 | 12763808 | import pytest
from models.brand import Brand
from models.customer import Customer
from models.giftcard import GiftCard
from service.gift_card_service import GiftCardService
class TestGiftService:
# def setup(self):
# # create brands
# apple = Brand("Apple", 5)
# walmart = Brand("Walmart"... | 2.75 | 3 |
setup.py | cocodrips/doc-cov | 14 | 12763809 | import io
import re
from setuptools import setup
try:
with open('README.md') as f:
readme = f.read()
except IOError:
readme = ''
with io.open('doccov/__init__.py', 'rt', encoding='utf8') as f:
version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
def _requires_from_file(filename):
... | 1.773438 | 2 |
guillotina_cms/vocabularies/content_layouts.py | alteroo/guillotina_cms | 5 | 12763810 | from guillotina import configure
from guillotina import app_settings
@configure.vocabulary(name="content_layouts")
class ContentLayoutVocabulary:
def __init__(self, context):
self.context = context
if hasattr(self.context, "context"):
self.values = app_settings["layouts"].get(self.cont... | 2.4375 | 2 |
mcg/sampling.py | nyu-dl/dl4mt-multi | 143 | 12763811 | <reponame>nyu-dl/dl4mt-multi
import logging
import copy
import numpy
import operator
import os
import re
import signal
import time
import theano
from blocks.extensions import SimpleExtension
from collections import OrderedDict
from subprocess import Popen, PIPE
from toolz import merge
from .utils import _p, get_enc_... | 1.539063 | 2 |
addons/website_helpdesk_support_ticket/models/type_of_subject.py | marionumza/vocal_v12 | 0 | 12763812 | <reponame>marionumza/vocal_v12
# -*- coding: utf-8 -*-
from odoo import models, fields
class TypeOfSubject(models.Model):
_name = 'type.of.subject'
name = fields.Char(
'Name',
required=True,
)
| 1.46875 | 1 |
pdbparse/construct/formats/filesystem/ext3.py | ax330d/ida_pdb_loader | 50 | 12763813 | <filename>pdbparse/construct/formats/filesystem/ext3.py
"""
Extension 3 (ext3)
Used primarily for concurrent Linux systems (ext2 + journalling)
"""
| 1.210938 | 1 |
ansys/dpf/core/field_definition.py | pscedu/DPF-Core | 0 | 12763814 | """
FieldDefinition
================
"""
from ansys import dpf
from ansys.grpc.dpf import (base_pb2,
field_definition_pb2, field_definition_pb2_grpc)
from ansys.dpf.core.common import natures, shell_layers
from ansys.dpf.core.dimensionality import Dimensionality
class FieldDefinition:
... | 2.34375 | 2 |
apps/manager/purpleserver/manager/migrations/0018_auto_20210705_1049.py | rcknr/purplship-server | 12 | 12763815 | # Generated by Django 3.2.5 on 2021-07-05 10:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manager', '0017_auto_20210629_1650'),
]
operations = [
migrations.AddField(
model_name='shipment',
name='reference',... | 1.507813 | 2 |
exercicios/ex051.py | CinatitBR/exercicios-phyton | 0 | 12763816 | termo1 = int(input('Digite o 1º termo da P.A: '))
razao = int(input('Digite a razão desta P.A: '))
decimo = termo1 + (10 - 1) * razao
for i in range(termo1, decimo + 1, razao):
print(i, end=' ')
| 3.890625 | 4 |
prkng/api/explorer.py | prkng/api | 7 | 12763817 | from prkng.models import ParkingLots, Slots
from flask import jsonify, Blueprint, request, send_from_directory
import os
explorer = Blueprint('explorer', __name__, url_prefix='/explorer')
slot_props = (
'id',
'geojson',
'rules',
'button_locations',
'way_name'
)
def init_explorer(app):
"""
... | 2.46875 | 2 |
dingtalk/contact/__init__.py | niulinlnc/dingtalk-python | 2 | 12763818 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time: 2018/2/28 下午2:05
# @Author: BlackMatrix
# @Site: https://github.com/blackmatrix7
# @File: __init__.py
# @Software: PyCharm
import logging
from .user import *
from .dept import *
from .role import *
from functools import partial
from ..foundation import dingtalk_met... | 2.359375 | 2 |
mail.py | FilippoRanza/mail.py | 0 | 12763819 | <gh_stars>0
#! /usr/bin/python3
# Copyright (c) 2019 <NAME> <<EMAIL>>
from argparse import ArgumentParser
from mail_sender import message_builder, load_destination
DEFAULT_SUBJECT = "A message from mail.py"
DEFAULT_CONFIG_FILE = "/etc/mail_config.json"
def setup_argparser():
out = ArgumentParser()
out.add... | 3 | 3 |
srtplayer.py | glymehrvrd/srtplayer | 0 | 12763820 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
import sys
import pysrt
import chardet
class ControlMainWindow(QtGui.QLabel):
def __init__(self, parent=None):
super(ControlMainWindow, self).__init__(parent)
# make window frameless, topmost and transparen... | 2.453125 | 2 |
working_stats.py | Koofus/Statistics | 0 | 12763821 | <reponame>Koofus/Statistics<gh_stars>0
import stats
import random
def get_data():
container = []
data = 0
i = 1
print("Enter any amount of numbers to be analyzed")
while True:
data = input("Input Number -->")
if data != 'done':
data = int(data)
co... | 3.5 | 4 |
2016/lab4/hastad/code.py | JustHitTheCore/ctf_workshops | 7 | 12763822 | # https://id0-rsa.pub/problem/11/
import gmpy2
def crt(a, n):
"""Chinese remainder theorem
from: http://rosettacode.org/wiki/Chinese_remainder_theorem#Python
x = a[0] % n[0]
x = a[1] % n[1]
x = a[2] % n[2]
Args:
a(list): remainders
n(list): modules
Returns:
lo... | 3.015625 | 3 |
MSBRadix.py | divine-coder/CODECHEF-PYTHON | 0 | 12763823 | import sys
def getQ(size):
bucket=[[] for i in range(size)]
return bucket
def noDigit(b):
return len(str(max(b)))
def getHash(val,i):
return (val%10**i)/(10**(i-1))
p1=0
def radix(b,i,no):
if i>=no:
return b
if len(b)<=1:
return b
bucket=getQ(10)
for elem in b:
p=... | 3.125 | 3 |
High School/9th Grade APCSP (Python)/Unit 8/08.01.01.py | SomewhereOutInSpace/Computer-Science-Class | 0 | 12763824 | lis = []
for i in range (10):
num = int(input())
lis.append(num)
print(lis)
for i in range (len(lis)):
print(lis[i])
| 3.65625 | 4 |
backend/music/models.py | ahanwaar/my-music-app | 0 | 12763825 | from django.db import models
class Artist(models.Model):
"""Database model for the Artists"""
name = models.CharField('Name', max_length=50, unique=True)
artist_poster = models.URLField(blank=True, null=True)
slug = models.SlugField(max_length=50, null=True, blank=True, unique=True)
class Meta:
... | 2.9375 | 3 |
python/clx/parsers/splunk_notable_parser.py | gbatmaz/clx | 0 | 12763826 | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 2.390625 | 2 |
arachne/tests/test_extensions.py | sliderSun/arachne | 137 | 12763827 | <filename>arachne/tests/test_extensions.py<gh_stars>100-1000
"""
To see if we have the right pipelines in place
"""
import inspect
from unittest import TestCase
from scrapy import signals, Field, Item
from mock import patch, mock_open, Mock, call
from arachne.extensions import ExportCSV, ExportData, ExportJSON
from scr... | 2.34375 | 2 |
test/examples/simple/tlm2/blocking_simple/initiator.py | rodrigomelo9/uvm-python | 140 | 12763828 | #//----------------------------------------------------------------------
#// Copyright 2010-2011 Mentor Graphics Corporation
#// Copyright 2010-2011 Synopsys, Inc
#// Copyright 2019-2020 <NAME> (tpoikela)
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "Lic... | 1.5625 | 2 |
Fun Excercise/factorial.py | NirmalSilwal/Python- | 32 | 12763829 | n = int(input('enter number to find the factorial: '))
fact=1;
for i in range(1,n+1,1):
fact=fact*i
print(fact)
| 4.1875 | 4 |
python/sandbox.py | LightningDash1755/HE | 61 | 12763830 | # import gettext
# gettext.bindtextdomain('messages', '/var/www/locale')
# gettext.textdomain('messages')
# t = gettext.translation('pt', '/var/www/locale', fallback=True)
# _ = t.ugettext
# # ...
# print _('Missing fields.')
print _('Task Managerr') | 2.15625 | 2 |
motivate.py | timitoc/motivate | 0 | 12763831 | <reponame>timitoc/motivate<filename>motivate.py
#!/usr/bin/env python3
import json
import os
import random
scriptpath = os.path.dirname(__file__)
data_dir = os.path.join(scriptpath, 'data')
num_of_json = len([f for f in os.listdir(data_dir)
if os.path.isfile(os.path.join(data_dir, f))])
rand_no = r... | 2.6875 | 3 |
python-fastapi-ca/src/infrastructure/students/repo/impl/MongoDBStudentRepositoryImpl1.py | solmars/python-fastapi-clean-architecture | 0 | 12763832 | <gh_stars>0
from typing import Union
from inject import autoparams
from loaders.database import DatabaseProvider
from models.student.StudentModel import StudentModel, UpdateStudentModel
from infrastructure.students.repo.StudentRepository import StudentRepository
class MongoDBStudentRepository(StudentRepository):
... | 2.4375 | 2 |
pycodeanalyzer/core/configuration/__init__.py | miong/pycodeanalyzer | 3 | 12763833 | <gh_stars>1-10
"""Configuration package.
This package handle all information that could be given to pycodeanalyzer in the configuration.
"""
| 1.171875 | 1 |
manast_database/migrations/0001_initial.py | oierajenjo/ManagementAssistant | 0 | 12763834 | # Generated by Django 2.2.13 on 2020-06-30 12:15
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('manast_site', '0001_initial'),
]
operations = [
migrations.CreateModel... | 1.867188 | 2 |
boardom/config/common.py | dmarnerides/boardom | 2 | 12763835 | <filename>boardom/config/common.py
import torch
from boardom import str2bool, process_path
import torchvision as tv
# MODEL CONFIG
_UPSAMPLE_TYPES = ['transpose', 'nearest', 'bilinear']
_DOWNSAMPLE_TYPES = [
'strided',
'nearest',
'bilinear',
'strided_preact_bbn',
'nearest_preact_bbn',
'bilinea... | 2.125 | 2 |
bot/Events.py | RamaDev09/CrateBot | 0 | 12763836 | <reponame>RamaDev09/CrateBot
from __future__ import print_function, unicode_literals
import os
from bot.TextInput import TextInput
from bot.prompt import color_msg
# Python Event
def CustomPythonEvent(name, extensions):
here = os.getcwd()
try:
with open(here + "/cogs/events/" + name + "." + ex... | 2.5625 | 3 |
bot/reviewbot/tools/pycodestyle.py | reviewboard/ReviewBot | 91 | 12763837 | <reponame>reviewboard/ReviewBot
"""Unit tests for reviewbot.tools.pycodestyle."""
from __future__ import unicode_literals
from reviewbot.config import config
from reviewbot.tools import BaseTool
from reviewbot.utils.process import execute
class PycodestyleTool(BaseTool):
"""Review Bot tool to run pycodestyle.""... | 2.5 | 2 |
multi_ear_services/util/__init__.py | Multi-EAR/Multi-EAR-software | 0 | 12763838 | """
multi_ear_services.util init
"""
# import all modules
from ..util.dataselect import DataSelect
from ..util.is_raspberry_pi import is_raspberry_pi
from ..util.parse_config import parse_config
__all__ = ['DataSelect', 'is_raspberry_pi', 'parse_config']
| 1.25 | 1 |
Ago-Dic-2019/ERIK EDUARDO MONTOYA MARTINEZ/PRACTICA 1/CAPITULO 3/YouOwnList.py | Arbupa/DAS_Sistemas | 41 | 12763839 | Automoviles=['Dodge Challeger', 'VW Gti', 'Jeep Rubicon', 'Alfa Romeo Quadro', 'Ford ST', 'Dodge RAM', 'Ford FX4']
M1="Me gustaria compar un " + Automoviles[0].title()+"."
M2="Mi vecino choco su nuevo " + Automoviles[1].title() + "."
M3="El nuevo " + Automoviles[2].title()+ " es mucho mas economico."
M4="Hay una gran d... | 3.03125 | 3 |
tensorflow2/IPU-replicas.py | Alwaysproblem/explore-ipu | 0 | 12763840 | from tensorflow.python.ipu import ipu_infeed_queue
from tensorflow.python.ipu import ipu_outfeed_queue
from tensorflow.python.ipu import loops
from tensorflow.python.ipu import utils
from tensorflow.python.ipu import ipu_strategy
import tensorflow as tf
# The dataset for feeding the graphs
ds = tf.data.Dataset.from_te... | 2.890625 | 3 |
src/lib/EUnNode.py | Amtoniusz/latte | 0 | 12763841 | <reponame>Amtoniusz/latte
from lib.compileException import compileException
class EUnNode():
def __init__(self, exp_type, expr, op, line):
self.exp_type = exp_type
self.expr = expr
self.op=op
self.line=line
self.const = None
self.type = None
self.get_const()
... | 3.078125 | 3 |
chmvh_website/team/migrations/0001_initial.py | chmvh/chmvh-website | 0 | 12763842 | <reponame>chmvh/chmvh-website<filename>chmvh_website/team/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-24 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import team.models
class Migration(migrations.Migration):
initial = True
... | 1.703125 | 2 |
setup.py | alserranor/distributions | 0 | 12763843 | from setuptools import setup
setup(name = 'statDistributions',
version = '1.0',
description = 'Gaussian and Binominal distributions',
packages = ['statDistributions'],
author = '<NAME>',
author_email = '<EMAIL>',
zip_safe = False)
| 1.03125 | 1 |
city_housing_index/local_admin/domains/register_domain.py | Sinope-Nanto/city_house | 0 | 12763844 | from local_auth.models import UserProfile
from local_auth.serializers import UserProfileSerializer
from django.contrib.auth.models import User
def get_waiting_register_list():
user_profiles = UserProfile.get_waiting_list()
return UserProfileSerializer(user_profiles, many=True).data
def get_waiting_register_d... | 2.328125 | 2 |
invocare/openssl/passphrase.py | jbronn/invocare-openssl | 0 | 12763845 | <reponame>jbronn/invocare-openssl
import os
def passphrase(arg):
if arg == 'stdin':
return 'stdin'
elif os.path.isfile(arg):
return 'file:"%s"' % arg
elif arg in os.environ:
return 'env:%s' % arg
else:
return 'pass:"%s"'
| 2.328125 | 2 |
crawlplates/crawlplates/module/stock.py | ZombieIce/A-Stock-Plate-Crawling | 0 | 12763846 | class Stock:
def __init__(self, symbol, name):
self.__name = name
self.__symbol = symbol
self.__stockPlate = []
self.__carePlate = []
@property
def name(self):
return self.__name
@property
def symbol(self):
return self.__symbol
@property
def... | 3.59375 | 4 |
in-develop/src/autobridge/Codegen/InjectPipelineLogic.py | Blaok/AutoBridge | 76 | 12763847 | <gh_stars>10-100
from collections import defaultdict
from typing import List, Dict
from autobridge.Opt.Slot import Slot
def get_ap_start_pipeline_def(slot_list: List[Slot], pipeline_level=4) -> List[str]:
pipeline_def = []
pipeline_def.append(f'// ----- pipelining the ap_start signal -----')
pipeline_def.ap... | 2.53125 | 3 |
src/textbook/rosalind_ba9d.py | cowboysmall/rosalind | 0 | 12763848 | <gh_stars>0
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import files
import arrays
import tree
def main(argv):
text = files.read_line(argv[0])
st = tree.SuffixTree(text)
print st.longest_repeat()
sa = arrays.suffix_array(text + '$')
ha = ... | 2.390625 | 2 |
network-tests/test_expire.py | victor-tucci/beldex-storage-server | 2 | 12763849 | import pyoxenmq
import ss
import time
import base64
import json
from nacl.encoding import HexEncoder, Base64Encoder
from nacl.hash import blake2b
from nacl.signing import VerifyKey
import nacl.exceptions
def test_expire_all(omq, random_mn, sk, exclude):
swarm = ss.get_swarm(omq, random_mn, sk)
mns = ss.random_... | 2.0625 | 2 |
src/templates/django/boilerplate/settings/development.py | GBrachetta/frames | 0 | 12763850 | <reponame>GBrachetta/frames<gh_stars>0
import os
# Import below from the common config as needed, and append to the list (+=)
from boilerplate.settings.common import INSTALLED_APPS, MIDDLEWARE
DEBUG = True
ALLOWED_HOSTS = [
os.environ.get("DOMAIN_NAME"), # Add in .env
"localhost",
"127.0.0.1",
]
INSTAL... | 1.8125 | 2 |