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 |
|---|---|---|---|---|---|---|
winchester/config.py | SandyWalsh/stacktach-winchester | 0 | 25800 | <filename>winchester/config.py
import collections
import logging
import os
import yaml
logger = logging.getLogger(__name__)
class ConfigurationError(Exception):
pass
class ConfigItem(object):
def __init__(self, required=False, default=None, help='', multiple=False):
self.help = help
self.re... | 2.625 | 3 |
apps/users/views.py | chenyifaerfans/fafaer-apis | 0 | 25801 | <reponame>chenyifaerfans/fafaer-apis<filename>apps/users/views.py
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth import get_user_model
from django.db.models import Q
from rest_framework import mixins
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticat... | 2.125 | 2 |
backend.py | Fennec2000GH/KeywordFS | 0 | 25802 |
from genericpath import exists, isfile
import json, os
from pprint import pprint
from keyword_extraction import *
from topic_modeling import *
# from xml_parser import *
def file_to_json(path: str, storage_path: str = 'storage'):
"""
Converts file containing text to stored JSON object to track topic... | 2.96875 | 3 |
tar.py | pakit/recipes | 1 | 25803 | <filename>tar.py<gh_stars>1-10
""" Formula for building tar """
import os
from pakit import Archive, Git, Recipe
class Tar(Recipe):
"""
The GNU tar utility.
"""
def __init__(self):
super(Tar, self).__init__()
self.homepage = 'https://www.gnu.org/software/tar'
self.repos = {
... | 3.03125 | 3 |
httpclient.py | forgeno/CMPUT404-assignment-web-client | 0 | 25804 | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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:/... | 3.03125 | 3 |
larcv/app/arxiv/arxiv/LArOpenCVHandle/mac/convert_test.py | mmajewsk/larcv2 | 14 | 25805 | import ROOT,sys
from larlite import larlite as fmwk1
from larcv import larcv as fmwk2
from ROOT import handshake
io1=fmwk1.storage_manager(fmwk1.storage_manager.kBOTH)
io1.add_in_filename(sys.argv[1])
io1.set_out_filename('boke.root')
io1.open()
io2=fmwk2.IOManager(fmwk2.IOManager.kREAD)
io2.add_in_file(sys.argv[2])
... | 1.976563 | 2 |
code/vectorized/vectorized_neural_network.py | le0x99/low-level-deep-learning | 0 | 25806 | <reponame>le0x99/low-level-deep-learning
import numpy as np
def sigmoid(Z): return 1./(1.+np.exp(-Z))
def softmax(Z): return np.exp(Z)/np.exp(Z).sum()
def softmax_batched(Z): return np.exp(Z) / np.sum(np.exp(Z), axis=1, keepdims=True)
def initialize_parameters():
W1 = np.random.randn(300,784) * 0.01
b1 = ... | 3.140625 | 3 |
test/shed_functional/functional/test_1000_install_basic_repository.py | innovate-invent/galaxy | 4 | 25807 | from shed_functional.base.twilltestcase import common, ShedTwillTestCase
class BasicToolShedFeatures(ShedTwillTestCase):
'''Test installing a basic repository.'''
def test_0000_initiate_users(self):
"""Create necessary user accounts."""
self.login(email=common.test_user_1_email, username=comm... | 2.203125 | 2 |
exceptional.py | kentoj/python-fundamentals | 6 | 25808 | <filename>exceptional.py
"""A module to demonstrate exceptions."""
import sys
from math import log
def convert(item):
"""
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
"""
try:
re... | 3.3125 | 3 |
tests/examples/minlplib/syn05m04h.py | ouyang-w-19/decogo | 2 | 25809 | # MINLP written by GAMS Convert at 04/21/18 13:54:28
#
# Equation counts
# Total E G L N X C B
# 363 141 12 210 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 1.609375 | 2 |
kitsune/gallery/models.py | jgmize/kitsune | 0 | 25810 | <gh_stars>0
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from kitsune.sumo.models import ModelBase, LocaleField
from kitsune.sumo.urlresolvers import reverse
from kitsune.sumo.utils import auto_delete_files
class Media(ModelB... | 2.015625 | 2 |
senseTk/__main__.py | Helicopt/senseToolkit | 2 | 25811 | <reponame>Helicopt/senseToolkit
import senseTk
if __name__ == '__main__':
print('senseToolkit version %s' % (senseTk.__version__))
| 1.039063 | 1 |
RaspberryPi/Hardware/UltrasonicSensorSet.py | amaankhan02/SelfDrivingCar | 0 | 25812 | import RPi.GPIO as gpio
from enum import Enum
import time
from GpioMode import GpioMode
from UltrasonicSensor import UltrasonicSensor
class UltrasonicSensorSet:
def __init__(self, *args:UltrasonicSensor):
"""
:param args: UltrasonicSensor objects
"""
self.ussSet = args
def getD... | 3.28125 | 3 |
m3u_to_channels.py | Axel-Erfurt/hypnotixLite | 3 | 25813 | <reponame>Axel-Erfurt/hypnotixLite
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
if len(sys.argv) < 3:
print("usage: python3 m3u_to_channels.py infile.m3u outfile.txt")
sys.exit()
else:
text = open(sys.argv[1], "r").read()
chList = []
urlList = []
mlist = text.splitlines()
for lin... | 2.9375 | 3 |
Experiments/RunTrainBasicClassification.py | christymarc/raycasting-simulation | 0 | 25814 | <gh_stars>0
from subprocess import run
compared_models = [
"resnet18",
"xresnet18",
"xresnet18_deep",
"xresnet18_deeper",
"xse_resnet18",
"xresnext18",
"xse_resnext18",
"xse_resnext18_deep",
"xse_resnext18_deeper",
"resnet50",
"xresnet50",
"xresnet50_deep",
"xresnet5... | 2.015625 | 2 |
ferry/config/cassandra/cassandraclientconfig.py | jhorey/ferry | 44 | 25815 | # Copyright 2014 OpenCore LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 1.8125 | 2 |
fn_mcafee_esm/setup.py | nickpartner-goahead/resilient-community-apps | 65 | 25816 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
from setuptools import setup, find_packages
setup(
name='fn_mcafee_esm',
version='1.0.2',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description="Resilient Circuits Components ... | 1.765625 | 2 |
addons14/storage_image/models/__init__.py | odoochain/addons_oca | 1 | 25817 | from . import storage_image
from . import storage_file
from . import storage_relation_abstract
| 1.109375 | 1 |
src/etl/etl.py | shy166/hinreddit | 0 | 25818 | <reponame>shy166/hinreddit
# import praw as pr
import pandas as pd
from src import *
import json
import requests
import pandas as pd
import os
from os.path import join
from tqdm import tqdm
import time
from joblib import Parallel, delayed
from p_tqdm import p_umap
from glob import glob
from requests.packages.urllib3.ex... | 2.578125 | 3 |
tanslate.py | Blues-star/bilibili-BV-conv | 0 | 25819 | table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF'
tr = {}
for i in range(58):
tr[table[i]] = i
s = [11, 10, 3, 8, 4, 6]
xor = 177451812
add = 8728348608
def dec(x):
r = 0
for i in range(6):
r += tr[x[s[i]]] * 58**i
return (r - add) ^ xor
def enc(x):
x = (x ^ xor) + add... | 2.609375 | 3 |
ddtrace/settings/exceptions.py | zhammer/dd-trace-py | 5 | 25820 | class ConfigException(Exception):
"""Configuration exception when an integration that is not available
is called in the `Config` object.
"""
pass
| 1.617188 | 2 |
nex/router.py | eddiejessup/nex | 0 | 25821 | from collections import deque
from enum import Enum
import logging
from .constants.codes import CatCode
from .constants.parameters import param_to_instr
from .constants.specials import special_to_instr
from .constants.instructions import (Instructions, if_instructions,
unexpanded_c... | 2.171875 | 2 |
nd-coursework/courses/computationalChemistry/scripts/plotEnergies.py | crdrisko/nd-grad | 1 | 25822 | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Name: plotEnergies.py - Version 1.0.0
# Author: <NAME> (crdrisko)
# Date: 10/18/2019-08:02:13
# Description: Plotting the relevant data for HW 4
import numpy as np
import matplotlib.pyplot as plt
### Results of the Vibrational Analysis ###
data_va = np.... | 2.265625 | 2 |
src/plugin.py | BradB111/galaxy_blizzard_plugin | 67 | 25823 | <reponame>BradB111/galaxy_blizzard_plugin
import asyncio
import json
import os
import sys
import multiprocessing
import webbrowser
from collections import defaultdict
import requests
import requests.cookies
import logging as log
import subprocess
import time
import re
from typing import Union, Dict
from galaxy.api.co... | 1.992188 | 2 |
kronos_executor/kronos_executor/execution_contexts/trivial.py | ecmwf/kronos | 4 | 25824 |
import pathlib
from kronos_executor.execution_context import ExecutionContext
run_script = pathlib.Path(__file__).parent / "trivial_run.sh"
class TrivialExecutionContext(ExecutionContext):
scheduler_directive_start = ""
scheduler_directive_params = {}
scheduler_use_params = []
scheduler_cancel_head... | 2.0625 | 2 |
mjmpc/control/gaussian_dmd.py | mohakbhardwaj/mjmpc | 2 | 25825 | <reponame>mohakbhardwaj/mjmpc
#!/usr/bin/env python
"""
A version of DMD-MPC with Gaussian sampling,
exponential utility cost function and
covariance adaptation
Author - <NAME>
Date - Jan 19, 2020
"""
from mjmpc.utils.control_utils import cost_to_go
from .olgaussian_mpc import OLGaussianMPC
import copy
import nump... | 2.03125 | 2 |
dbModel.py | eric033014/Line-bot | 104 | 25826 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
app = Flask(__name__)
app.config[
'SQLALCHEMY_DATABASE_URI'] = 'postgres://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
db = SQLAlchemy(app)
migrate = Migrate(app, db)
manage... | 2.546875 | 3 |
modules/finance/social_security_audit/code/list_social_security_audit.py | xuhuiliang-maybe/ace_office | 1 | 25827 | <gh_stars>1-10
# coding=utf-8
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import permission_required
from django.views.generic import ListView
from modules.finance.social_security_audit.models import *
from modules.share_module.formater import *
from modules.share_modu... | 2.140625 | 2 |
split_dataset/split_dataset.py | si-you/tools | 0 | 25828 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
from absl import app
from absl import flags
import pandas as pd
FLAGS = flags.FLAGS
flags.DEFINE_string('dataset', None, 'A path to the dataset.')
flags.DEFINE_float('test_fraction', 0.2, 'A sp... | 2.953125 | 3 |
src/charter/axis.py | paw-lu/charter | 0 | 25829 | <gh_stars>0
"""A unicode number line."""
import bisect
import dataclasses
import math
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import rich.columns
import rich.measure
import rich.table
import rich.text
from rich.console import Console... | 2.78125 | 3 |
exercises/bssid-based/receive.py | ramonfontes/tutorials | 3 | 25830 | <filename>exercises/bssid-based/receive.py<gh_stars>1-10
#!/usr/bin/env python
import sys
import os
from binascii import hexlify
from scapy.all import sniff
from scapy.all import TCP, Raw
allowed_bssids = ['020000000200']
reg_mac = []
def handle_pkt(pkt):
if TCP in pkt and pkt[TCP].dport == 1234 and Raw in pkt:
... | 2.6875 | 3 |
mmo_module/__init__.py | alentoghostflame/StupidAlentoBot | 1 | 25831 | from mmo_module.mmo import MMOModule
| 1.117188 | 1 |
kattis/I've Been Everywhere, Man.py | jaredliw/python-question-bank | 1 | 25832 | # CPU: 0.09 s
for _ in range(int(input())):
print(len(set(input() for _ in range(int(input())))))
| 3.03125 | 3 |
demo/multimodal/offline/QA/index_and_export/src/modeling.py | meta-soul/MetaSpore | 32 | 25833 | #
# Copyright 2022 DMetaSoul
#
# 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 writin... | 1.90625 | 2 |
079_Valores_unicos_em_uma_lista.py | fabioeomedeiros/Python-Base | 0 | 25834 | <filename>079_Valores_unicos_em_uma_lista.py
#079_Valores_unicos_em_uma_lista.py
lista = []
print("")
while True:
n = int(input("Adicione valor: "))
if n not in lista:
lista.append(n)
print(f"Valor {n} adicionado com sucesso")
else:
print(f"Valor {n} duplicado NÃO adicionado")
... | 3.8125 | 4 |
dcapi/dcapi.py | lethargilistic/dcapi-wrap | 0 | 25835 | import requests
from urllib.parse import urlparse
from os.path import join
#TODO: Break into separate standard settings module
ROOT_URL = 'http://progdisc.club/~lethargilistic/proxy'
HEADERS = {'User-Agent': 'dcapi-wrap (https://github.com/lethargilistic/dcapi-wrap)'}
def set_url(url):
if urlparse(url):
R... | 2.875 | 3 |
imagenet/utils.py | ayanc/tf-boilerplate | 2 | 25836 | <reponame>ayanc/tf-boilerplate
# <NAME> <<EMAIL>>
import re
import os
from glob import glob
import numpy as np
# Find all indices of labels with class cls
def find(labels,cls):
return np.array(range(len(labels)))[labels == cls]
# Raw load text file
def load(fname):
data = []
labels = []
for line in o... | 2.5 | 2 |
TWLight/i18n/urls.py | nicole331/TWLight | 67 | 25837 | from django.conf import settings
from django.conf.urls import url
from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path
from TWLight.i18n.views import set_language
# Direct rip from django.conf.urls.i18n, but imports our local set_language
# from GitHub
def i18n_patterns(*urls, prefix_default_... | 1.960938 | 2 |
fq/agent/naive.py | valkiii/connect_four | 0 | 25838 | import random
from fq.agent.base import Agent
from fq.four_board import Move
from fq.four_types import Point
class RandomBot(Agent):
def select_move(self, game_state):
'''
Choose a random valid move
'''
candidates = []
for c in range(1, game_state.board.num_cols +1):
... | 2.84375 | 3 |
nsdistort.py | PyryM/northstar-distortion | 1 | 25839 | import math
import numpy as np
import cv2
import json
import argparse
def augment_homogeneous(V, augment):
""" Augment a 3xN array of vectors into a 4xN array of homogeneous coordinates
Args:
v (np.array 3xN): Array of vectors
augment (float): The value to fill in for the W coordinate
Retu... | 3.390625 | 3 |
chainer_bcnn/links/connection/pixel_shuffle_upsampler.py | yuta-hi/bayesian_unet | 36 | 25840 | from __future__ import absolute_import
import chainer
import chainer.functions as F
from .convolution import ConvolutionND
def _pair(x, ndim=2):
if hasattr(x, '__getitem__'):
return x
return [x]*ndim
class PixelShuffleUpsamplerND(chainer.Chain):
"""Pixel Shuffler for the super resolution.
Th... | 2.90625 | 3 |
bin/createLinkograph.py | mikiec84/linkshop | 6 | 25841 | <reponame>mikiec84/linkshop<filename>bin/createLinkograph.py
#!/usr/bin/env python3
"""Command-line wrapper for linkoCreate.cli_createLinko."""
import loadPath # Adds the project path.
import linkograph.linkoCreate
linkograph.linkoCreate.cli_createLinko()
| 1.492188 | 1 |
setup.py | gift-surg/endocal | 0 | 25842 | """A compact GUI application for optical distortion calibration of endoscopes.
See:
https://github.com/gift-surg/endocal
"""
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
doc_dir = path.abspath(path.join(path.dirname(__file__), 'doc'))
# Get the summary
summ... | 1.851563 | 2 |
pyglfw/test-opengl-2.1-vbo-shader.py | martijnberger/OpenGL-tests | 0 | 25843 | <reponame>martijnberger/OpenGL-tests<filename>pyglfw/test-opengl-2.1-vbo-shader.py
__author__ = '<NAME>'
import OpenGL.GL as gl
import numpy as np
import ctypes
import glfw
vertex_code = """
#version 120
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_FrontColor = gl_Color;
}
""... | 2.328125 | 2 |
tests/dataframesource/sources/test_dataikusource.py | telia-oss/birgitta | 8 | 25844 | import sys
from unittest.mock import MagicMock, patch # noqa F401
import mock
import pytest # noqa F401
# TODO: Simplify the mocking of private (unavailable) dataiku lib.
# Current mocking is ugly and complex.
if 'dataiku.Dataset' in sys.modules:
del sys.modules['dataiku.Dataset']
if 'dataiku' in sys.modules:
... | 1.890625 | 2 |
Final Project/Final Project Code/UnityRosHusky/src/Mobile-Robot-Navigation-and-Mapping/mobile_robot_navigation_project/scripts/bug0.py | AdityaPradhan1/Nokia_Bell_Labs-MIT_Manipal-ROS_Mapping_Platform | 3 | 25845 | #! /usr/bin/env python
"""
.. module:: bug0
:platform: Unix
:synopsis: Python module for implementing the bug0 path planning algorithm
.. moduleauthor:: <NAME> <EMAIL>
This node implements the bug0 path planning algorithm for moving a robot from its current
position to some target position.
Subscribe... | 2.90625 | 3 |
recorded_future/komand_recorded_future/actions/lookup_domain/action.py | xhennessy-r7/insightconnect-plugins | 0 | 25846 | <reponame>xhennessy-r7/insightconnect-plugins
import komand
from .. import demo_test
from .schema import LookupDomainInput, LookupDomainOutput
class LookupDomain(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='lookup_domain',
description='Thi... | 1.992188 | 2 |
Python3/838.push-dominoes.py | 610yilingliu/leetcode | 0 | 25847 | <filename>Python3/838.push-dominoes.py
#
# @lc app=leetcode id=838 lang=python3
#
# [838] Push Dominoes
#
# @lc code=start
class Solution:
def pushDominoes(self, dominoes: str) -> str:
l = 0
ans = []
dominoes = 'L' + dominoes + 'R'
for r in range(1, len(dominoes)):
if do... | 3.46875 | 3 |
ode/deserializers.py | LiberTIC/ODE | 2 | 25848 | <filename>ode/deserializers.py<gh_stars>1-10
import csv
import json
import re
import six
from six import StringIO
from ics import Calendar
from ics.parse import ParseError
def default_extractor(attribute):
def extractor(event):
if hasattr(event, attribute):
return getattr(event, attribute)
... | 2.71875 | 3 |
src/poker_now_log_converter/player.py | charlestudor/PokerNowLogConverter | 1 | 25849 | # -*- coding: utf-8 -*-
""" Provides the Player class as part of the PokerNowLogConverter data model"""
from dataclasses import dataclass
@dataclass
class Player:
""" The Player class represents a player in a particular hand of poker.
Players start without an alias, which can be set using a method once the ... | 4 | 4 |
数据结构/NowCode/37_Print.py | Blankwhiter/LearningNotes | 0 | 25850 | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 返回二维列表[[1,2],[4,5]]
def Print(self, pRoot):
if pRoot == None:
return []
queue1 = [pRoot]
queue2 = []
ret = []
while queue1 or q... | 3.6875 | 4 |
dirmon/dirmon/dirmon.py | ytreister/stoq-plugins-public | 72 | 25851 | # Copyright 2014-present PUNCH Cyber Analytics Group
#
# 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... | 1.820313 | 2 |
bg.py | Blue-IT-Marketing/sa-loans | 0 | 25852 | <reponame>Blue-IT-Marketing/sa-loans<filename>bg.py
import os
import webapp2
import jinja2
from google.appengine.ext import ndb
from google.appengine.api import users
from google.appengine.api import mail
import datetime,random,string
from google.appengine.api import memcache
import logging
#Jinja Loader
template_env ... | 2.234375 | 2 |
pystella/fit/fit_lc.py | baklanovp/pystella | 1 | 25853 | <reponame>baklanovp/pystella<filename>pystella/fit/fit_lc.py
import numpy as np
class FitLc:
def __init__(self, name):
self._name = name
self._par = {'is_info': False, 'is_debug': False, 'is_quiet': True}
def print_parameters(self):
print(f'Parmeters of {self.Name}')
for k, v ... | 2.453125 | 2 |
tests/KG2E/run_tucker.py | walker-liu/fennlp | 1 | 25854 | <filename>tests/KG2E/run_tucker.py
#! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@Author:<NAME>
"""
import numpy as np
import tensorflow as tf
from fennlp.datas.graphloader import TuckERLoader
from fennlp.metrics import Metric
from fennlp.models import tucker
lr = 0.005
label_smoothing = 0.1
batch_size = 128
trai... | 2.625 | 3 |
blogjaguar/apps/blog/categorylister.py | darioblanco/blogjaguar | 0 | 25855 | <reponame>darioblanco/blogjaguar
# Copyright 2011 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 1.765625 | 2 |
Implementations/transformer-tf2implementation/tf2_util_layer.py | YifanWu1994/ML-Papers | 2 | 25856 | import tensorflow as tf
from tensorflow.keras.layers import *
assert tf.__version__>="2.0.0", f"Expect TF>=2.0.0 but get {tf.__version__}"
class PositionalSinEmbedding(tf.keras.layers.Layer):
"""
Positional Sinusoidal Embedding layer as described in "Attention is All You Need".
|
| Parameters:
| | input_dim: pa... | 2.65625 | 3 |
src/users/models/microsoftgraphteam_messaging_settings.py | peombwa/Sample-Graph-Python-Client | 0 | 25857 | <reponame>peombwa/Sample-Graph-Python-Client
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# ------------------------------------... | 1.710938 | 2 |
setup.py | shraman-rc/SecFS | 2 | 25858 | <filename>setup.py
#!/usr/bin/env python3
from distutils.core import setup
setup(
name='SecFS',
version='0.1.0',
description='6.858 final project --- an encrypted and authenticated file system',
long_description= open('README.md', 'r').read(),
author='<NAME>',
author_email='<EMAIL>',
maint... | 1.25 | 1 |
IG_bots/classes/bot.py | domidanke/Make-Me-Famous | 2 | 25859 | import sys
sys.path.insert(1, '../')
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import random
from random import randint
from functions import config, wait
class Bot:
def __init__(self):
self.cred... | 2.6875 | 3 |
eventkit_cloud/jobs/migrations/0011_add_file_data_providers.py | venicegeo/eventkit-cloud | 1 | 25860 | # Generated by Django 3.1.2 on 2021-01-27 18:43
from django.db import migrations
class Migration(migrations.Migration):
def add_file_data_providers(apps, schema_editor):
DataProviderType = apps.get_model("jobs", "DataProviderType")
ExportFormat = apps.get_model("jobs", "ExportFormat")
# ... | 2.015625 | 2 |
Pythonista/Editor/make_zip.py | walogo/Pythonista-scripts | 2 | 25861 | <reponame>walogo/Pythonista-scripts
from sys import argv
from shutil import make_archive,copy2,copytree,move
from os import mkdir,rmdir,chdir,listdir,getcwd,remove
from os.path import isdir,join
def erase(file):
if isdir(file):
for f in listdir(file):
erase(join(file,f))
rmdir(file)
else:
remove(file)
def c... | 3.046875 | 3 |
setup.py | rps-v/crate-admin | 24 | 25862 | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | 1.664063 | 2 |
Final_Project/top_ten_tags/mapper_top_ten_tags.py | saturator22/hadoop-mapreduce-udacity | 0 | 25863 | #!/usr/bin/python
import sys
import csv
def mapper():
reader = csv.reader(sys.stdin, delimiter='\t')
writer = csv.writer(sys.stdout, delimiter='\t')
tagFrequency = {}
for line in reader:
nodeType = line[5]
if not nodeType == "question":
continue
tags... | 3.203125 | 3 |
src/utils/url_parsers.py | googleinterns/connectivity-test | 0 | 25864 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 2.5625 | 3 |
python/dlbs/exceptions.py | robertengelmann/dlcookbook-dlbs | 1 | 25865 | <gh_stars>1-10
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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 re... | 2.546875 | 3 |
fbpic/picmi/simulation.py | wilds9/fbpic | 1 | 25866 | # Copyright 2019, FBPIC contributors
# Authors: <NAME>, <NAME>
# License: 3-Clause-BSD-LBNL
"""
This file is part of the Fourier-Bessel Particle-In-Cell code (FB-PIC)
It defines the picmi Simulation interface
"""
import numpy as np
from scipy.constants import c, e, m_e
from .particle_charge_and_mass import particle_ch... | 1.976563 | 2 |
pyrobud/custom_modules/autoadmin.py | x0x8x/pyrobud | 0 | 25867 | <gh_stars>0
import asyncio
import telethon as tg
from telethon.tl.types import PeerUser
from pyrobud import module
class AutoAdminModule(module.Module):
name = "Auto Admin"
no_events = [
"UpdateNewChannelMessage", "UpdateMessageID", "UpdateReadChannelInbox", "UpdateReadChannelOutbox",
"Upda... | 2.234375 | 2 |
algorithms/genetic_algorithm.py | khiemdoan/tsp-ga-pso | 1 | 25868 | from .base import Algorithm
import random
from copy import deepcopy
from models import Tour
from typing import List, Tuple
n_population = 100
CXPB = 0.95
MUTPB = 0.1
class GeneticAlgorithm(Algorithm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.population: Lis... | 3.046875 | 3 |
api/esprr_api/tests/test_utils.py | wholmgren/ESPRR | 4 | 25869 | <filename>api/esprr_api/tests/test_utils.py
import datetime as dt
from functools import partial
from io import BytesIO
from fastapi import HTTPException
import pandas as pd
import pyarrow as pa
import pytest
from esprr_api import utils
httpfail = partial(
pytest.param, marks=pytest.mark.xfail(strict=True, rai... | 2.109375 | 2 |
snakegame_v3.py | kz114109/project-ouroboros | 0 | 25870 | import random, pygame
import tkinter as tk
from tkinter import messagebox
pygame.init()
def text_format(message, textFont, textSize, textColor):
newFont=pygame.font.Font(textFont, textSize)
newText=newFont.render(message, 0, textColor)
return newText
font = "Retro.ttf"
class cube(object):
rows = 5... | 3.140625 | 3 |
vistrails/gui/shell.py | celiafish/VisTrails | 1 | 25871 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: <EMAIL>
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or wi... | 1 | 1 |
stdlib2-src/dist-packages/quodlibet/qltk/dbus_.py | ch1huizong/Scode | 0 | 25872 | <filename>stdlib2-src/dist-packages/quodlibet/qltk/dbus_.py
# Copyright 2006 <NAME> <<EMAIL>>
# 2013 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import dbus
... | 2.203125 | 2 |
score/models.py | loric-/bcvscore | 1 | 25873 | <filename>score/models.py<gh_stars>1-10
from django.db import models
from django.contrib.auth.models import User
from solo.models import SingletonModel
class Division(models.Model):
nom = models.CharField(max_length=30)
def __str__(self):
return self.nom
class Equipe(models.Model):
nom = models... | 2.140625 | 2 |
migrations/versions/4a7d74b38564_.py | te11ur/twitter_watcher | 0 | 25874 | """empty message
Revision ID: 4a7d74b38564
Revises: <PASSWORD>
Create Date: 2017-02-16 16:09:46.859183
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a<PASSWORD>b<PASSWORD>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():... | 1.429688 | 1 |
GlueCustomConnectors/glueJobValidation/glue_job_validation_update.py | xy1m/aws-glue-samples | 925 | 25875 | <gh_stars>100-1000
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import sys
from awsglue.utils import getResolvedOptions
from awsglue.transforms import *
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job ... | 2.421875 | 2 |
SQLITE1/database.py | Alexelofu/sqlite | 0 | 25876 | #importing dependencies
import sqlite3
#creating a connection and also the database or connecting to the database if it exists already
conn = sqlite3.connect('student.db')
#Creating the cursor
c = conn.cursor()
#creating a table called students
c.execute("""CREATE TABLE students(
first_name text,
... | 4.09375 | 4 |
alumni/admin.py | ayushganguli1769/DevelopmentRobotix | 0 | 25877 | from django.contrib import admin
from .models import Alumni
# Register your models here.
admin.site.register(Alumni)
| 1.28125 | 1 |
standalone/demo_texas.py | apalomES/plug | 0 | 25878 | <reponame>apalomES/plug<gh_stars>0
from uuid import uuid4
from powersimdata import Scenario
scenario = Scenario()
print(scenario.state.name)
scenario.set_grid(interconnect="Texas")
scenario.set_name("test", "comp_" + str(uuid4()))
scenario.set_time("2016-01-01 00:00:00", "2016-01-01 03:00:00", "1H")
scenario.set_b... | 1.953125 | 2 |
examples/shape_example/shape_example/server.py | reevesj191/mesa | 1 | 25879 | import random
from mesa.visualization.modules import CanvasGrid
from mesa.visualization.ModularVisualization import ModularServer
from .model import Walker, ShapeExample
def agent_draw(agent):
portrayal = None
if agent is None:
# Actually this if part is unnecessary, but still keeping it for
... | 2.8125 | 3 |
AeroComBAT/__init__.py | bennames/AeroComBAT-Project | 13 | 25880 | """A tool for modeling composite beams and aircraft wings.
``Aerodynamics``
This module provides the aerodynamics models used within AeroComBAT
``AircraftParts``
This module provides a full-fledged wing object that can be used to
determine if a design is both statically adequate as well as stable.
``... | 1.445313 | 1 |
redbot/message/headers/date.py | jakub-g/redbot | 1 | 25881 | #!/usr/bin/env python
from redbot.message import headers
from redbot.syntax import rfc7231
from redbot.type import AddNoteMethodType
class date(headers.HttpHeader):
canonical_name = "Date"
description = """\
The `Date` header represents the time when the message was generated, regardless of caching that
happ... | 2.5 | 2 |
python/plugins/processing/algs/qgis/ImportIntoSpatialite.py | dyna-mis/Hilabeling | 0 | 25882 | <reponame>dyna-mis/Hilabeling
# -*- coding: utf-8 -*-
"""
***************************************************************************
ImportIntoSpatialite.py
---------------------
Date : October 2016
Copyright : (C) 2016 by <NAME>
Email : nirvn dot asia at ... | 1.132813 | 1 |
padre/authorizers.py | krislindgren/padre | 0 | 25883 | import abc
import itertools
from oslo_utils import reflection
import six
from padre import exceptions as excp
from padre import utils
@six.add_metaclass(abc.ABCMeta)
class auth_base(object):
"""Base of all authorizers."""
def __and__(self, other):
return all_must_pass(self, other)
def __or__(s... | 2.65625 | 3 |
migration/test/test_print_status.py | xypnox/Submitty | 0 | 25884 | <reponame>xypnox/Submitty<gh_stars>0
from argparse import Namespace
from io import StringIO
from pathlib import Path
import shutil
import sys
import tempfile
import unittest
from .helpers import create_migration
import migrator
class TestPrintStatus(unittest.TestCase):
def setUp(self):
self.stdout = sy... | 2.28125 | 2 |
skspec/IO/gwu_interfaces.py | hugadams/scikit-spectra | 83 | 25885 | <filename>skspec/IO/gwu_interfaces.py
''' Utilities for converting various file formats to a skspec TimeSpectra.
To convert a list of raw files, use from_spec_files()
To convert old-style timefile/spectral data file, use from_timefile_datafile()
To convert spectral datafiles from Ocean Optics USB2000 and USB650, pas... | 2.578125 | 3 |
test/jubatus_test/classifier/test.py | gwtnb/jubatus-python-client | 0 | 25886 | <reponame>gwtnb/jubatus-python-client<filename>test/jubatus_test/classifier/test.py
#!/usr/bin/env python
import unittest
import json
import msgpackrpc
from jubatus.classifier.client import Classifier
from jubatus.classifier.types import *
from jubatus_test.test_util import TestUtil
from jubatus.common import Datum
... | 1.976563 | 2 |
code/utils/losses_2.py | mantuoluozk/MFC | 161 | 25887 | <filename>code/utils/losses_2.py
# import torch
# from torch.nn import functional as F
import numpy as np
from scipy.ndimage import distance_transform_edt as distance
from skimage import segmentation as skimage_seg
def compute_dtm(img_gt, out_shape, normalize=False, fg=False):
"""
compute the distance transfor... | 2.125 | 2 |
setup.py | Feeeenng/flask-3auth | 13 | 25888 | <reponame>Feeeenng/flask-3auth<gh_stars>10-100
# -*- coding: UTF-8 -*-
'''
@author: 'FenG_Vnc'
@date: 2017-08-08 17:06
@file: setup.py
'''
from __future__ import unicode_literals
from setuptools import setup,find_packages
setup(
name='Flask-thridy',
version='0.0.3',
description='simple use thridy for log... | 1.3125 | 1 |
gprm/utils/vector.py | siwill22/GPlatesClassStruggle | 7 | 25889 | <reponame>siwill22/GPlatesClassStruggle
import pygplates
from .create_gpml import create_gpml_healpix_mesh
def get_velocities(rotation_model,topology_features,time,velocity_domain_features=None,delta_time=1,velocity_type='MagAzim'):
if velocity_domain_features is None:
velocity_domain_features = create_gp... | 2.546875 | 3 |
config/users/views.py | sitepoint-editors/Django-photo-app | 0 | 25890 | from django.views.generic import CreateView
from django.contrib.auth import authenticate, login
from django.contrib.auth.views import LoginView
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse_lazy
class SignUpView(CreateView):
template_name = 'users/signup.html'
... | 2.1875 | 2 |
_cleaning_options/cleaner.py | coreybobco/gutenberg_cleaner | 0 | 25891 | import re
from _cleaning_options.cleaning_options import _is_title_or_etc, _is_books_copy, \
_is_email_init, _is_footnote, _is_image, _is_table
from _cleaning_options.strip_headers import _strip_headers
def simple_cleaner(book: str) -> str:
"""
Just removes lines that are part of the Project Gutenberg hea... | 3.390625 | 3 |
app/family/family.py | rafamartinc/upm-ingsoft-tfg | 0 | 25892 | <gh_stars>0
# -*- coding: utf-8 -*-
import os
from app.family.member import Member
from app.model.gates import EnumGates
from app.model.quantumstate import QuantumState
from app.model.sequence import Sequence
from app.view.view import View
__author__ = '<NAME>-<NAME>'
class Family:
def __init__(self, length, m... | 2.921875 | 3 |
crashreports/rest_api_logfiles.py | FairphoneMirrors/hiccup-server | 0 | 25893 | """REST API for accessing log files."""
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import generics, status
from rest_framework.decorators import (
api_view... | 2.21875 | 2 |
src/secondaires/systeme/commandes/systeme/__init__.py | vlegoff/tsunami | 14 | 25894 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 <NAME>
# 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 ... | 1.570313 | 2 |
ocdata/bulk_obj.py | cesmix-mit/Open-Catalyst-Dataset | 0 | 25895 |
import math
import numpy as np
import os
import pickle
from pymatgen.core.surface import SlabGenerator, get_symmetrically_distinct_miller_indices
from pymatgen.io.ase import AseAtomsAdaptor
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from .constants import MAX_MILLER, COVALENT_MATERIALS_MPIDS
class Bu... | 2.703125 | 3 |
core/management/commands/create_users.py | marcesher/collab | 0 | 25896 | from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from core.models import Person, OfficeLocation, OrgGroup
import random
class Command(BaseCommand):
args = '<number_of_users>'
help = 'Creates random users for local testing'
def handle(self, *args, **option... | 2.046875 | 2 |
tests/cloudformation/graph_builder/test_local_graph.py | nvuillam/checkov | 0 | 25897 | <reponame>nvuillam/checkov<filename>tests/cloudformation/graph_builder/test_local_graph.py
import os
from unittest import TestCase
from checkov.cloudformation.graph_builder.graph_components.block_types import BlockType
from checkov.cloudformation.graph_builder.local_graph import CloudformationLocalGraph
from checkov.c... | 2.328125 | 2 |
stc_StyledTextCtrl.py | Jalkhov/wxGlade | 0 | 25898 | """
TODO: What kind of syntax is handled in the Preview "language" type? Raw?
"""
import keyword
import wx
import wx.stc as stc
if wx.Platform == '__WXMSW__':
faces = { 'times': 'Times New Roman',
'mono' : 'Courier New',
'helv' : 'Arial',
'other': 'Comic Sans MS',
... | 2.34375 | 2 |
compress.py | jpritt/boiler | 13 | 25899 | import alignments
import re
import read
import binaryIO
import math
import os
import preprocess
import time
class Compressor:
aligned = None
# 0 - zlib
# 1 - lzma
# 2 - bz2
compressMethod = 0
covSize = 0
totalSize = 0
def __init__(self, frag_len_cutoff):
if self.compressMetho... | 2.6875 | 3 |