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 |
|---|---|---|---|---|---|---|
uncompy3/decomp_dec.py | Alpha-Demon404/RE-14 | 39 | 18500 | # MENTOL
# At:Sun Nov 24 15:04:31 2019
if len(bytecode) == 0:
print('\x1b[1;93mbyte code kosong\nharap masukkan bytecodenya\x1b[0m')
exit()
import marshal, sys, os, random, string, time
try:
from uncompyle6.main import decompile
except:
os.system('pip install uncompyle6')
from uncompyle6.main imp... | 2.5 | 2 |
tests/unit/proxy/roundtrip/test_janus_graph_proxy.py | joshthoward/amundsenmetadatalibrary | 3 | 18501 | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import Any, Mapping
import unittest
from .abstract_gremlin_proxy_tests import abstract_gremlin_proxy_test_class
from .roundtrip_janusgraph_proxy import RoundtripJanusGraphProxy
class JanusGraphGremlinProxyTest(
... | 1.921875 | 2 |
scripts/performance/config.py | atsgen/tf-test | 5 | 18502 | from builtins import str
from builtins import range
from builtins import object
import os
import fixtures
import testtools
from vn_test import VNFixture
from vm_test import VMFixture
from common.connections import ContrailConnections
from policy_test import PolicyFixture
from policy.config import AttachPolicyFixture
f... | 1.960938 | 2 |
deepspeech_pytorch/testing.py | Chudbrochil/deepspeech.pytorch-2.1 | 13 | 18503 | <reponame>Chudbrochil/deepspeech.pytorch-2.1
import hydra
import torch
from tqdm import tqdm
from deepspeech_pytorch.configs.inference_config import EvalConfig
from deepspeech_pytorch.decoder import GreedyDecoder
from deepspeech_pytorch.loader.data_loader import SpectrogramDataset, AudioDataLoader
from deepspeech_pyto... | 2.171875 | 2 |
api/aps3/tasklist/tasklist/main.py | Gustavobb/megadados | 0 | 18504 | <gh_stars>0
# pylint: disable=missing-module-docstring
from fastapi import FastAPI
from .routers import task, user
tags_metadata = [
{
'name': 'task',
'description': 'Operations related to tasks.',
},
]
app = FastAPI(
title='Task list',
description='Task-list project for the **Megadad... | 1.734375 | 2 |
silver_bullet/contain_value.py | Hojung-Jeong/Silver-Bullet-Encryption-Tool | 0 | 18505 | <reponame>Hojung-Jeong/Silver-Bullet-Encryption-Tool
'''
>List of functions
1. contain(value,limit) - contains a value between 0 to limit
'''
def contain(value,limit):
if value<0:
return value+limit
elif value>=limit:
return value-limit
else:
return value | 3.609375 | 4 |
code/train.py | TONGJINGLV/dagan | 0 | 18506 | from data import NumericalField, CategoricalField, Iterator
from data import Dataset
from synthesizer import MaskGenerator_MLP, ObservedGenerator_MLP, Discriminator, Handler, ObservedGenerator_LSTM
from random import choice
import multiprocessing
import pandas as pd
import numpy as np
import torch
import argparse
impor... | 2.375 | 2 |
front-end/testsuite-python-lib/Python-3.1/Lib/test/test_pep277.py | MalloyPower/parsing-python | 1 | 18507 | # Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from test import support
if not os.path.supports_unicode_filenames:
raise unittest.SkipTest("test works only on NT+")
filenames = [
'abc',
'... | 2.625 | 3 |
test/unit/test_utils.py | managedbyq/q-dbt | 1 | 18508 | <reponame>managedbyq/q-dbt<filename>test/unit/test_utils.py
import unittest
import dbt.utils
class TestDeepMerge(unittest.TestCase):
def test__simple_cases(self):
cases = [
{'args': [{}, {'a': 1}],
'expected': {'a': 1},
'description': 'one key into empty'},
... | 2.46875 | 2 |
results.py | ejnnr/steerable_pdo_experiments | 0 | 18509 | import argparse
from pathlib import Path
import numpy as np
import yaml
# this script takes in a folder path and then recursively collects all
# results.yaml files in that directory. It averages them and prints
# summary statistics
parser = argparse.ArgumentParser(description="Analyze the results")
parser.add_argume... | 3.3125 | 3 |
Pgnet.py | rs-lsl/Pgnet | 2 | 18510 | <filename>Pgnet.py
# -*- coding: utf-8 -*-
"""
@author: lsl
E-mail: <EMAIL>
"""
import sys
import argparse
sys.path.append("/home/aistudio/code")
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as data
import time
from Pgnet_structure import Pg_net
from Pgnet_dat... | 2.265625 | 2 |
tracing/plugins/ath10k_pktlog.py | lumag/qca-swiss-army-knife | 47 | 18511 | <reponame>lumag/qca-swiss-army-knife
#
# Copyright (c) 2014-2017 Qualcomm Atheros, Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWA... | 1.320313 | 1 |
tgtypes/models/venue.py | autogram/tgtypes | 0 | 18512 | <gh_stars>0
from __future__ import annotations
from typing import TYPE_CHECKING, Optional
from ._base import TelegramObject
if TYPE_CHECKING: # pragma: no cover
from .location import Location
class Venue(TelegramObject):
"""
This object represents a venue.
Source: https://core.telegram.org/bots/a... | 2.640625 | 3 |
nsa.py | hypervis0r/nsaproductgenerator | 0 | 18513 | import random
import argparse
# TODO: Parse word lists from files
words = {
"codenames_adjective": [
"quantum",
"loud",
"red",
"blue",
"green",
"yellow",
"irate",
"angry",
"peeved",
"happy",
"slimy",
"sleepy",
"junior",
"slicker",
"united",
... | 3.234375 | 3 |
bob/blitz/extension.py | bioidiap/bob.blitz | 0 | 18514 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
# Mon 18 Nov 21:38:19 2013
"""Extension building for using this package
"""
import numpy
from pkg_resources import resource_filename
from bob.extension import Extension as BobExtension
# forward the build_ext command from bob.extension
from bob.... | 2.125 | 2 |
src/RosGazeboLibrary/Gazebo.py | hielsnoppe/robotframework-rosgazebolibrary | 0 | 18515 | from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn
class Gazebo(object):
"""Robot Framework test library for the Gazebo simulator
See also http://gazebosim.org/tutorials/?tut=ros_comm
== Table of contents ==
%TOC%
"""
ROBOT_LIBRARY_SCOPE = 'SUITE'
def __init... | 2.5 | 2 |
tests/unit/test_hass.py | boonhapus/hautomate | 0 | 18516 | <filename>tests/unit/test_hass.py
from ward import test, each, raises
from homeassistant.core import HomeAssistant
from hautomate.settings import HautoConfig
from hautomate import Hautomate
import pydantic
from tests.fixtures import cfg_data_hauto
@test('HomeAssistantConfig validates for {feed}', tags=['unit'])
asy... | 2.09375 | 2 |
test/arguments/with_range_check_code/python/Bit4RangeCheckTest.py | dkBrazz/zserio | 86 | 18517 | import unittest
import zserio
from testutils import getZserioApi
class Bit4RangeCheckTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "with_range_check_code.zs",
extraArgs=["-withRangeCheckCode"]).bit4_range_check
def testB... | 2.578125 | 3 |
src/MainAPP/migrations/0030_auto_20181211_1246.py | mizamae/HomeAutomation | 0 | 18518 | <filename>src/MainAPP/migrations/0030_auto_20181211_1246.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-12-11 11:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('MainAPP', '... | 1.703125 | 2 |
qdms/PulsedProgramming.py | 3it-nano/QDMS | 1 | 18519 | import numpy as np
import math
import time
class PulsedProgramming:
"""
This class contains all the parameters for the Pulsed programming on a memristor model.
After initializing the parameters values, start the simulation with self.simulate()
Parameters
----------
max_voltage : float
... | 3.828125 | 4 |
tests/test_push.py | associatedpress/datakit-dworld | 2 | 18520 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# from unittest import mock
# from datakit_dworld.push import Push
def test_push(capsys):
"""Sample pytest test function with a built-in pytest fixture as an argument.
"""
# cmd = Greeting(None, None, cmd_name='dworld push')
# parsed_args = mock.Mock()
... | 2.609375 | 3 |
cool_filter.py | Andrea055/Imager | 7 | 18521 | import cv2
import numpy as np
from scipy.interpolate import UnivariateSpline
class Cool(object):
"""cool_filter ---
This class will apply cool filter to an image
by giving a sky blue effect to the input image.
"""
def __init__(self):
# create look-up tables for increasing and decreasing red and blue resp.
... | 3.140625 | 3 |
src/evaluators/sample_evaluators/swd_sample_evaluator.py | gmum/cwae-pytorch | 4 | 18522 | import torch
from metrics.swd import sliced_wasserstein_distance
from evaluators.sample_evaluators.base_sample_evaluator import BaseSampleEvaluator
from noise_creator import NoiseCreator
class SWDSampleEvaluator(BaseSampleEvaluator):
def __init__(self, noise_creator: NoiseCreator):
self.__noise_... | 2.203125 | 2 |
topic-db/topicdb/core/models/language.py | anthcp-infocom/Contextualise | 184 | 18523 | <gh_stars>100-1000
"""
Language enumeration. Part of the StoryTechnologies project.
June 12, 2016
<NAME> (<EMAIL>)
"""
from enum import Enum
class Language(Enum):
# https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
# https://en.wikipedia.org/wiki/ISO_639-2
ENG = 1 # English
SPA = 2 # Spanish... | 2.71875 | 3 |
utils/migrations/0002_alter_electricitybilling_unit_price_and_more.py | shumwe/rental-house-management-system | 1 | 18524 | # Generated by Django 4.0.3 on 2022-04-02 17:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('utils', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='electricitybilling',
name='unit_price',... | 1.742188 | 2 |
lemur/roles/views.py | pandragoq/lemur | 0 | 18525 | """
.. module: lemur.roles.views
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from flask import Blueprint
from flask import make_response, jsonify, abort, g
from flask.ext.restful import re... | 2.3125 | 2 |
backend/core/workspaces/dataView.py | makakken/roseguarden | 0 | 18526 | """
The roseguarden project
Copyright (C) 2018-2020 <NAME>,
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is ... | 1.992188 | 2 |
demo/video_gpuaccel_demo.py | chenxinfeng4/mmdetection | 1 | 18527 | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import cv2
import mmcv
import numpy as np
import torch
from torchvision.transforms import functional as F
from mmdet.apis import init_detector
from mmdet.datasets.pipelines import Compose
try:
import ffmpegcv
except ImportError:
raise ImportErro... | 2.34375 | 2 |
scripts/benchmark_1_rdomset.py | bluegenes/spacegraphcats | 0 | 18528 | <reponame>bluegenes/spacegraphcats
#! /usr/bin/env python
"""
Benchmark the rdomset (catlas level 1) algorithm, without I/O considerations.
"""
import sys, os
# add spacegraphcats package to import path:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import spacegraphcats
from spacegraphcats.catlas ... | 2.390625 | 2 |
pyob/mixins/pyob_set_label.py | khunspoonzi/pyob | 0 | 18529 | # ┌─────────────────────────────────────────────────────────────────────────────────────
# │ PYOB SET LABEL MIXIN
# └─────────────────────────────────────────────────────────────────────────────────────
class PyObSetLabelMixin:
"""A mixin class for PyOb set label methods"""
# ┌───────────────────────────────... | 3.21875 | 3 |
proto/twowfuck.py | hanss314/twowfuck | 0 | 18530 | import time
from hashlib import sha1
class InfArray():
def __init__(self):
self.left = [0]*16
self.right = [0]*16
def getarr(self, ind):
arr = self.right
if ind < 0: arr, ind = self.left, -ind-1
if ind >= len(arr): arr.extend([0]* (key - len(arr) + 10))
return a... | 3.015625 | 3 |
simba/process_data_log.py | justinshenk/simba | 1 | 18531 | <gh_stars>1-10
import pandas as pd
import os
from configparser import ConfigParser, NoSectionError, NoOptionError
from datetime import datetime
import numpy as np
import glob
from simba.rw_dfs import *
def analyze_process_data_log(configini,chosenlist):
dateTime = datetime.now().strftime('%Y%m%d%H%M%S')... | 2.328125 | 2 |
SphinxReportPlugins/MatplotlibPlugin/__init__.py | Tim-HU/sphinx-report | 1 | 18532 | <gh_stars>1-10
import os
import re
import warnings
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.image as image
from matplotlib import _pylab_helpers
from matplotlib.cbook import exception_to_str
import seaborn
from SphinxReport.Component import *
from SphinxReport import Config, Utils
class Ma... | 2.25 | 2 |
nips2018/utils/plotting.py | kovacspe/Sinz2018_NIPS | 5 | 18533 | <filename>nips2018/utils/plotting.py
import cv2
import imageio
import numpy as np
import matplotlib.pyplot as plt
from itertools import product, zip_longest
import seaborn as sns
def grouper(n, iterable, fillvalue=None):
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args)
def rename(re... | 2.234375 | 2 |
src/tests/samples.py | BeholdersEye/PyBitmessage | 5 | 18534 | """Various sample data"""
from binascii import unhexlify
magic = 0xE9BEB4D9
# These keys are from addresses test script
sample_pubsigningkey = unhexlify(
'<KEY>'
'<KEY>')
sample_pubencryptionkey = unhexlify(
'<KEY>'
'e7b9b97792327851a562752e4b79475d1f51f5a71352482b241227f45ed36a9')
sample_privsignin... | 2.25 | 2 |
court_scraper/platforms/wicourts/pages/search.py | mscarey/court-scraper | 1 | 18535 | from urllib.parse import parse_qs
from anticaptchaofficial.hcaptchaproxyless import hCaptchaProxyless
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from court_scraper.base.selenium_helpers import Sel... | 2.25 | 2 |
bitmovin_api_sdk/encoding/encodings/muxings/mp3/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 11 | 18536 | from bitmovin_api_sdk.encoding.encodings.muxings.mp3.mp3_api import Mp3Api
from bitmovin_api_sdk.encoding.encodings.muxings.mp3.customdata.customdata_api import CustomdataApi
from bitmovin_api_sdk.encoding.encodings.muxings.mp3.information.information_api import InformationApi
from bitmovin_api_sdk.encoding.encodings.m... | 1.132813 | 1 |
platform/bl_interface.py | sumasree98/2022-ectf-insecure-example | 0 | 18537 | # 2022 eCTF
# Bootloader Interface Emulator
# <NAME>
#
# (c) 2022 The MITRE Corporation
#
# This source file is part of an example system for MITRE's 2022 Embedded System
# CTF (eCTF). This code is being provided only for educational purposes for the
# 2022 MITRE eCTF competition, and may not meet MITRE standards for q... | 2.3125 | 2 |
Excel_python_demo.py | SJG88/excel_vba_python | 0 | 18538 | # -*- coding: utf-8 -*-
"""
This is a script to demo how to open up a macro enabled excel file, write a pandas dataframe to it
and save it as a new file name.
Created on Mon Mar 1 17:47:41 2021
@author: <NAME>
"""
import os
import xlwings as xw
import pandas as pd
os.chdir(r"C:\Users\<NAME>\Desktop\Ro... | 3.21875 | 3 |
code/Elipsoide_Clark_FAT.py | birocoles/paper-magnetic-elipsoid | 1 | 18539 | <filename>code/Elipsoide_Clark_FAT.py<gh_stars>1-10
from __future__ import division
import numpy as np
from scipy import linalg
from matplotlib import pyplot as plt
from fatiando.gravmag import sphere
from fatiando import mesher, gridder, utils
from fatiando.vis import mpl
import scipy.special
import scipy.interpolat... | 2.71875 | 3 |
app.py | aserhatdemir/digitalocean | 0 | 18540 | from do import DigitalOcean
import argparse
import json
def do_play(token):
do = DigitalOcean(token)
# ----
# for i in range(3):
# do.create_droplet(f'node-{i}', 'fra1', 'do-python')
# do.wait_droplet_creation_process('do-python')
# ----
# do.destroy_droplets('do-python')
# ----
... | 2.546875 | 3 |
convert_twitter_data.py | charlieyou/data-science-final-project | 0 | 18541 | import cPickle as pickle
import pandas as pd
if __name__ == '__main__':
fnames = set(['clinton_tweets.json', 'trump_tweets.json'])
for fname in fnames:
df = pd.read_json('data/' + fname)
df = df.transpose()
df = df['text']
pickle.dump([(i, v) for i, v in zip(df.index, df.values... | 2.84375 | 3 |
app.py | mwinel/python-cicd-assignement | 0 | 18542 | import os
import logging
from flask import Flask
app = Flask(__name__)
@app.route('/status')
def health_check():
app.logger.info('Status request successfull')
app.logger.debug('DEBUG message')
return 'OK - healthy'
@app.route('/metrics')
def metrics():
app.logger.info('Metrics request successfull')... | 2.5625 | 3 |
Configuration/StandardSequences/python/L1Reco_cff.py | ckamtsikis/cmssw | 852 | 18543 | <filename>Configuration/StandardSequences/python/L1Reco_cff.py
import FWCore.ParameterSet.Config as cms
from L1Trigger.Configuration.L1TReco_cff import *
| 1.203125 | 1 |
pysrc/common/dataset_mod.py | Hibiki1020/classification_attitude_estimator | 0 | 18544 | <gh_stars>0
import torch.utils.data as data
from PIL import Image
import numpy as np
import math
import csv
class ClassOriginaldataset(data.Dataset):
def __init__(self, data_list, transform, phase, index_dict_path, dim_fc_out):
self.data_list = data_list
self.transform = transform
self.ph... | 2.40625 | 2 |
scripts/darias_energy_control/moveit_traj_baseline/repulsive_potential_field.py | hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators | 0 | 18545 | import numpy as np
import torch
import matplotlib.pyplot as plt
from icecream import ic
def visualize_vector_field(policy, device, min_max = [[-1,-1],[1,1]], fig_number=1):
min_x = min_max[0][0]
max_x = min_max[1][0]
min_y = min_max[0][1]
max_y = min_max[1][1]
n_sample = 100
x = np.linspace(m... | 2.265625 | 2 |
capa/features/extractors/ida/extractor.py | pombredanne/capa | 0 | 18546 | <gh_stars>0
# Copyright (C) 2020 FireEye, Inc. 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: [package root]/LICENSE.txt
# Unless required by applicable law or agreed to... | 2.109375 | 2 |
Tests/playground.py | mbtaPredict/Main | 0 | 18547 | <filename>Tests/playground.py
import matplotlib.pyplot as plt
plt.plot()
plt.show() | 1.28125 | 1 |
flex/extensions/jsondata.py | AWehrhahn/flex-format | 0 | 18548 | <reponame>AWehrhahn/flex-format
# -*- coding: utf-8 -*-
from __future__ import annotations
from tarfile import TarInfo
from typing import BinaryIO, Tuple
from ..base import FlexExtension
class JsonDataExtension(FlexExtension):
"""An extension to store simple json data"""
def __init__(self, header=None, dat... | 2.484375 | 2 |
awards/forms.py | danalvin/Django-IP3 | 0 | 18549 | <filename>awards/forms.py
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
exclude = ['profile', 'posted_time', 'user']
| 1.671875 | 2 |
src/tale/syntax/grammar/TaleParser.py | tale-lang/tale | 17 | 18550 | # Generated from tale/syntax/grammar/Tale.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\... | 1.585938 | 2 |
004.py | gabrieleliasdev/python-cev | 0 | 18551 | print('Olá, Mundo!')
print(7+4)
print('7'+'4')
print('Olá', 5)
# Toda variável é um objeto
# Um objeto é mais do que uma variável
nome = 'Gabriel'
idade = 30
peso = 79
print(nome,idade,peso)
nome = input('>>> Nome ')
idade = input('>>> Idade ')
peso = input('>>> Peso ')
print(nome,idade,peso)
print(f'Nome:{nom... | 3.875 | 4 |
examples/create_mac_table_entry.py | open-switch/opx-docs | 122 | 18552 | #Python code block to configure MAC address table entry
import cps_utils
#Register the attribute type
cps_utils.add_attr_type('base-mac/table/mac-address', 'mac')
#Define the MAC address, interface index and VLAN attributes
d = {'mac-address': '00:0a:0b:cc:0d:0e', 'ifindex': 18, 'vlan': '100'}
#Create a CPS object
... | 2.625 | 3 |
win/GUI/Configuration.py | WeAreAVP/mdqc | 8 | 18553 | # -*- coding: UTF-8 -*-
'''
Created on May 14, 2014
@author: <NAME> <<EMAIL>>
'''
import os, datetime, sys, platform, base64
class Configuration(object):
def __init__(self):
# Constructor
if os.name == 'posix':
self.OsType = 'linux'
elif os.name == 'nt':
self.OsT... | 2.25 | 2 |
MainController.py | samuelvp360/Microbiological-Assay-Calculator | 0 | 18554 | <reponame>samuelvp360/Microbiological-Assay-Calculator<filename>MainController.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
from pathlib import Path
from datetime import datetime
from PyQt5 import QtCore as qtc
from PyQt5 import QtWidgets as qtw
from PyQt5 import uic
import numpy as np
from M... | 2.234375 | 2 |
events/defaults.py | bozbalci/cython-experiments | 1 | 18555 | # defaults.py: contains the built-in variables, events and methods
# used for scripting the C program
import event
events = {}
_event_names = ["on_start", "on_exit"]
for evt in _event_names:
events[evt] = event.Event()
| 2.28125 | 2 |
src/parse_text.py | rflieshman/BOLSTM | 13 | 18556 | <filename>src/parse_text.py<gh_stars>10-100
from itertools import combinations
import numpy as np
import spacy
import sys
from spacy.tokenizer import Tokenizer
import re
from subprocess import PIPE, Popen
import os
import logging
import networkx as nx
import en_core_web_sm
import string
from neg_gv import neg_gv_list
... | 2.546875 | 3 |
metadata-ingestion/examples/library/dataset_set_tag.py | cuong-pham/datahub | 1,603 | 18557 | # Imports for urn construction utility methods
import logging
from datahub.emitter.mce_builder import make_dataset_urn, make_tag_urn
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
# Imports for metadata model classes
from datahub.metadata.sche... | 2.203125 | 2 |
examples/Old Format/matrix_latex.py | waldyrious/galgebra | 151 | 18558 | from __future__ import print_function
from sympy import symbols, Matrix
from galgebra.printer import xpdf, Format
def main():
Format()
a = Matrix ( 2, 2, ( 1, 2, 3, 4 ) )
b = Matrix ( 2, 1, ( 5, 6 ) )
c = a * b
print(a,b,'=',c)
x, y = symbols ( 'x, y' )
d = Matrix ( 1, 2, ( x ** 3, y ** 3... | 2.609375 | 3 |
hopsapp/__init__.py | mrahman013/Hope4Hops-web-applcation | 0 | 18559 | """Implements a basic flask app that provides hashes of text."""
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_login
#pylint: disable=invalid-name
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://yjjuylsytqewni:d0d63322c6abd33e2dadeafd... | 2.71875 | 3 |
npytoImage.py | x35yao/camera | 0 | 18560 | import numpy as np;
import cv2;
n = 428671
img_RS_color = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_color.npy'.format(n))
cv2.imshow('RS Color Image {}'.format(n), img_RS_color)
#
# # img_RS_depth = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_depth.np... | 2.359375 | 2 |
magenta/music/sequences_lib.py | jellysquider/magenta | 0 | 18561 | # Copyright 2016 Google Inc. 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 applicable law or ag... | 2.296875 | 2 |
tests/index_jsonurl_test.py | Stidsty/dismantle | 0 | 18562 | <gh_stars>0
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 2.15625 | 2 |
src/resdk/__init__.py | AGregorc/resolwe-bio-py | 4 | 18563 | """Resolwe SDK for Python."""
from .collection_tables import CollectionTables # noqa
from .resdk_logger import log_to_stdout, start_logging # noqa
from .resolwe import Resolwe, ResolweQuery # noqa
| 1.117188 | 1 |
helper/validation_scripts/launch-lm-profile.py | NanoMembers/DeepFlow | 3 | 18564 | <gh_stars>1-10
#!/tools/python/python3.8.3/bin/python
import os
import shutil
import subprocess
import numpy as np
batch_list=[i*1024 for i in range(2,7)]
seq_list=[10]
hidden_list=[i*1024 for i in range(2,7)]
vocab_list=[2048] #[int(i) for i in (2**np.linspace(10,13,20)//2*2)]
layer_list=[1]
bpe_list=[10]
epoch_list=... | 2.15625 | 2 |
src/planet_box_extractor/extractor.py | V-AI-S/planet-box-extractor | 6 | 18565 | <filename>src/planet_box_extractor/extractor.py
from .geo_utils import boundingBox
import time
import PIL.Image
import urllib.request
import mercantile
import numpy as np
class PlanetBoxExtractor:
"""
Extract bounding boxes from satellite images using Planet Tiles API
@radius: distance from the cen... | 3.28125 | 3 |
Kai/python/modules/mctruth.py | NJManganelli/FourTopNAOD | 1 | 18566 | <reponame>NJManganelli/FourTopNAOD
from __future__ import (division, print_function)
import os
import ROOT
#import numpy as np
#import itertools
#from collections import OrderedDict
ROOT.PyConfig.IgnoreCommandLineOptions = True
from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object... | 1.84375 | 2 |
skimpy/utils/namespace.py | AQ18/skimpy | 13 | 18567 | <reponame>AQ18/skimpy<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EP... | 1.820313 | 2 |
app/urlshortener.py | felixbade/minimal-url-shortener | 0 | 18568 | class URLShortener:
def __init__(self):
self.id_counter = 0
self.links = {}
def getURL(self, short_id):
return self.links.get(short_id)
def shorten(self, url):
short_id = self.getNextId()
self.links.update({short_id: url})
return short_id
def getNextId... | 2.96875 | 3 |
designate/storage/impl_sqlalchemy/migrate_repo/versions/051_scoped_tsig.py | cneill/designate-testing | 0 | 18569 | <filename>designate/storage/impl_sqlalchemy/migrate_repo/versions/051_scoped_tsig.py
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obta... | 1.945313 | 2 |
geomat/stein/migrations/0060_remove_mineraltype_mohs_scale.py | mimischi/django-geomat | 3 | 18570 | <gh_stars>1-10
# Generated by Django 2.0.2 on 2018-05-04 07:33
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stein', '0059_mineraltype_new_mohs_scale'),
]
operations = [
migrations.AlterField(
model_na... | 1.640625 | 2 |
bamboo/core/calculator.py | pld/bamboo | 27 | 18571 | from collections import defaultdict
from celery.task import task
from pandas import concat, DataFrame
from bamboo.core.aggregator import Aggregator
from bamboo.core.frame import add_parent_column, join_dataset
from bamboo.core.parser import Parser
from bamboo.lib.datetools import recognize_dates
from bamboo.lib.jsont... | 2.265625 | 2 |
modules/python3/tests/unittests/scripts/glm.py | ImagiaViz/inviwo | 349 | 18572 | import inviwopy
from inviwopy.glm import *
v1 = vec3(1,2,3)
v2 = size2_t(4,5)
m1 = mat4(1)
m2 = mat3(0,1,0,-1,0,0,0,0,2)
v3 = m2 * v1
v4 = vec4(1,2,3,4)
w = v4.w
a = v4.a
q = v4.q
z = v4.z
b = v4.b
p = v4.p
y = v4.y
g = v4.g
t = v4.t
x = v4.x
r = v4.r
s = v4.s
| 2.125 | 2 |
djangoexample/thumbs/views.py | arneb/sorethumb | 0 | 18573 | <reponame>arneb/sorethumb
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.conf import settings
from models import ThumbTest
from sorethumb.filters.defaultfilters import *
from sorethumb.filters.drawfilters import *
from soreth... | 2.0625 | 2 |
hello_world.py | michaeljamieson/Python01 | 0 | 18574 | print ('hello world')
print ('hey i did something')
print ('what happens if i do a ;');
print ('apparently nothing')
| 2.03125 | 2 |
start.py | AndrewJanuary/PM-Monitor | 0 | 18575 | <reponame>AndrewJanuary/PM-Monitor
from app.sensor import Sensor
from app.uploader import Uploader
from app.offline import Offline
import time, logging, argparse, sys, random, datetime
logging.basicConfig(filename='airquality.log', level=logging.DEBUG, filemode='a',
format='%(asctime)s - %(name)s -... | 2.765625 | 3 |
py_trees_ros/visitors.py | geoc1234/py_trees_ros | 65 | 18576 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: BSD
# https://raw.githubusercontent.com/splintered-reality/py_trees_ros/devel/LICENSE
#
##############################################################################
# Documentation
###########################################################################... | 2.59375 | 3 |
Jarvis/features/Friday_Blueprint.py | faizeraza/Jarvis-Virtual-Assistant- | 1 | 18577 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Friday_Blueprint.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | 1.742188 | 2 |
pints/toy/_logistic_model.py | iamleeg/pints | 0 | 18578 | <reponame>iamleeg/pints
#
# Logistic toy model.
#
# This file is part of PINTS.
# Copyright (c) 2017-2019, University of Oxford.
# For licensing information, see the LICENSE file distributed with the PINTS
# software package.
#
from __future__ import absolute_import, division
from __future__ import print_function, u... | 3.28125 | 3 |
poo/pybank/bank.py | fredsonchaves07/python-fundamentals | 0 | 18579 | class Bank:
def __init__(self):
self.__agencies = [1111, 2222, 3333]
self.__costumers = []
self.__accounts = []
def insert_costumers(self, costumer):
self.__costumers.append(costumer)
def insert_accounts(self, account):
self.__accounts.append(account)
def authe... | 3.546875 | 4 |
homeworks/vecutil.py | JediKoder/coursera-CodeMatrix | 3 | 18580 | <filename>homeworks/vecutil.py<gh_stars>1-10
# Copyright 2013 <NAME>
from vec import Vec
def list2vec(L):
"""Given a list L of field elements, return a Vec with domain {0...len(L)-1}
whose entry i is L[i]
>>> list2vec([10, 20, 30])
Vec({0, 1, 2},{0: 10, 1: 20, 2: 30})
"""
return Vec(set(range(... | 3.609375 | 4 |
squidpy/im/_container.py | Emberwhirl/squidpy | 1 | 18581 | from __future__ import annotations
from copy import copy, deepcopy
from types import MappingProxyType
from typing import (
Any,
Union,
Mapping,
TypeVar,
Callable,
Iterable,
Iterator,
Sequence,
TYPE_CHECKING,
)
from pathlib import Path
from functools import partial
from itertools imp... | 1.726563 | 2 |
users/forms.py | kurosh-wss/Personal-Finance-Management | 0 | 18582 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from crispy_bootstrap5.bootstrap5 import FloatingField
from crispy_forms.layout import Layout
from crispy_forms.helper import FormHelper
class CustomUserCreationForm(UserCreationForm):
email = forms.EmailField()
class Meta(UserCr... | 2.0625 | 2 |
tutorzzz_reminder/reminder.py | xiebei1108/tools | 0 | 18583 | import json
import requests
import config
assignedIdList = list()
def __getList():
HEADERS = {
'Cookie': config.tutorzzzCookie,
'Content-Type': 'application/json'
}
res = requests.post(config.tutorzzzURL, headers = HEADERS, json = config.tutorzzzReqBody)
if res.status_code == 200:
... | 2.765625 | 3 |
invoicing/crud/invoice_crud.py | dnegreira/Invoicing | 0 | 18584 | from invoicing.crud.base_crud import BaseCrud
from invoicing.latex.latex_invoice import LatexInvoice
from invoicing.models.invoice_model import InvoiceModel
from invoicing.repository.invoice_repository import InvoiceRepository
from invoicing.repository.job_repository import JobRepository
from invoicing.ui.date import D... | 2.15625 | 2 |
ds3225_client.py | kim-tom/dbus_server | 0 | 18585 | from ds3225 import DS3225
import dbus
import dbus.mainloop.glib
import dbus.service
from gi.repository import GObject, GLib
UNLOCKED_DEG = 175
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
BUS_NAME = 'jp.kimura.DS3225Service'
OBJECT_PATH = '/jp/kimura/DS3225Server'
INTERFACE = 'jp.kimura.DS3225'
class DS3225... | 2.21875 | 2 |
Extra kunskap/Kod/Farmen.py | abbindustrigymnasium/Programmering-1-Slutuppgift | 0 | 18586 | <reponame>abbindustrigymnasium/Programmering-1-Slutuppgift<filename>Extra kunskap/Kod/Farmen.py<gh_stars>0
import openpyxl
wb= openpyxl.load_workbook('Farmen.xlsx')
# sheet= wb.active
# print(wb.get_sheet_names())
# Deltagar_sheet= wb.get_sheet_by_name('Deltagare')
# artists=[{"Namn":sheet.cell(row=i, column=2).... | 2.46875 | 2 |
archive/simple_nn.py | petebond/MarketPlaceML | 0 | 18587 | from os import access
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import numpy as np
import matplotlib.pyplot as plt
# Create fully connected neural network
class NN(nn.Module):
d... | 3.09375 | 3 |
plot_loss.py | ngachago/tabular_comp | 0 | 18588 |
import matplotlib.pyplot as plt
def plot_loss_mae(history):
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('Model loss')
plt.ylabel('Loss')
plt.xlabel('Epoch')
plt.legend(['Train', 'Validation'], loc='best')
plt.show()
plt.plot(history.history['mae']... | 3 | 3 |
hotkey.py | RMPiria/painelContreole | 0 | 18589 | # -*- coding: utf-8 -*-
import os
from os.path import dirname, join, normpath
import sys
from sys import platform
from config import config
if platform == 'darwin':
import objc
from AppKit import NSApplication, NSWorkspace, NSBeep, NSSound, NSEvent, NSKeyDown, NSKeyUp, NSFlagsChanged, NSKeyDownMask, NSFlag... | 2.0625 | 2 |
Chapter10/ch10_r1_grover_aqua.py | georgekorpas/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience | 24 | 18590 | <reponame>georgekorpas/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience<filename>Chapter10/ch10_r1_grover_aqua.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created Nov 2020
@author: hassi
"""
from qiskit import Aer, IBMQ
# Do the necessary import for our program
from qiskit.aqua.algorith... | 2.875 | 3 |
setup_pre-commit.py | fierte-product-development/Setups | 1 | 18591 | <filename>setup_pre-commit.py
import sys
import os
import subprocess
from subprocess import PIPE, STDOUT
from pathlib import Path
proc_arg = {
'shell': True,
'stdout': PIPE,
'text': True
}
def _run(*cmd):
proc = subprocess.run(cmd, **proc_arg, stderr=PIPE)
return proc.stdout.repl... | 2.40625 | 2 |
5-buscar.py | gustavodp22/TP_DE_-CRUD-create-read-update-delete- | 0 | 18592 | <reponame>gustavodp22/TP_DE_-CRUD-create-read-update-delete-
"""
CRUD de SQLite3 con Python 3
"""
import sqlite3
try:
bd = sqlite3.connect("libros.db")
cursor = bd.cursor()
busqueda = input("Escribe tu búsqueda: ")
if not busqueda:
print("Búsqueda inválida")
exit()
sentencia = "SELECT * FROM... | 3.46875 | 3 |
tests/advanced_tests/regressors.py | amlanbanerjee/auto_ml | 1,671 | 18593 | <reponame>amlanbanerjee/auto_ml<filename>tests/advanced_tests/regressors.py
import datetime
import os
import random
import sys
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
from auto_ml import Predictor
from auto_ml.utils_models import load_ml_model
import dill
from nose.tools import assert_equal... | 2.53125 | 3 |
__init__.py | amueller/information-theoretic-mst | 20 | 18594 | from itm import ITM
__all__ = ['ITM']
| 1.15625 | 1 |
scripts/left_right_hemisphere_data/hemisphere_asymmetry.py | mwinding/connectome_analysis | 1 | 18595 | <filename>scripts/left_right_hemisphere_data/hemisphere_asymmetry.py
import pandas as pd
import numpy as np
import csv
# import synapses divided across hemispheres
hemisphere_data = pd.read_csv('left_right_hemisphere_data/brain_hemisphere_membership.csv', header = 0)
#print(hemisphere_data)
# import pair list CSV, ma... | 2.71875 | 3 |
__determineTripplesSumToZeroFromList.py | simdevex/01.Basics | 0 | 18596 | '''
Python program to determine which triples sum to zero from a given list of lists.
Input: [[1343532, -2920635, 332], [-27, 18, 9], [4, 0, -4], [2, 2, 2], [-20, 16, 4]]
Output:
[False, True, True, False, True]
Input: [[1, 2, -3], [-4, 0, 4], [0, 1, -5], [1, 1, 1], [-2, 4, -1]]
Output:
[True, True, False, False, False... | 4.25 | 4 |
fastNLP/modules/encoder/lstm.py | h00Jiang/fastNLP | 0 | 18597 | import torch.nn as nn
class Lstm(nn.Module):
"""
LSTM module
Args:
input_size : input size
hidden_size : hidden size
num_layers : number of hidden layers. Default: 1
dropout : dropout rate. Default: 0.5
bidirectional : If True, becomes a bidirectional RNN. Default: False.
"""
... | 3.28125 | 3 |
geoLocApp/signals.py | KKWaxy/geoLoc | 0 | 18598 | from django.db.models.signals import pre_save,post_save
from django.dispatch import receiver
import geoLocApp.models
import geoLocApp.distance
# @receiver(post_save,sender=geoLocApp.models.Position,dispatch_uid="only_before_registered")
# def setDistance(sender, **kwargs):
# position = kwargs["instance"]
... | 2.140625 | 2 |
src/main/python/shabda/data/iterators/internal/data_iterator_base.py | dhiraa/sabdha | 4 | 18599 | # Copyright 2018 The Shabda 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 applicable... | 2.09375 | 2 |