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 |
|---|---|---|---|---|---|---|
wagtail/users/models.py | originell/wagtail | 0 | 11600 | import os
import uuid
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
def upload_avatar_to(instance, filename):
filename, ext = os.path.splitext(filename)
return os.path.join(
'avatar_images',
'avatar_{uuid}_{filename}{ext}... | 2.109375 | 2 |
python/simulator.py | chongdashu/puzzlescript-analyze | 1 | 11601 | __author__ = '<NAME>, <EMAIL>'
import uinput
def Simulator():
def __init__(self):
pass
def test1(self):
device = uinput.Device([uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O])
device.emit_click(uinput.KEY_H)
| 1.546875 | 2 |
PRESUBMIT.py | oneumyvakin/catapult | 0 | 11602 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for catapult.
See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... | 1.453125 | 1 |
exam_at_home/2/boolean_expression.py | jamie-jjd/110_spring_IDS | 2 | 11603 | <gh_stars>1-10
# author: jamie
# email: <EMAIL>
def Priority (c):
if c == '&': return 3
elif c == '|': return 2
elif c == '^': return 1
elif c == '(': return 0
def InfixToPostfix (infix, postfix):
stack = []
for c in infix:
if c == '(':
stack.append('(')
elif c == ... | 3.8125 | 4 |
workoutlog/workout/admin.py | michaelrodgers/itc172_final | 0 | 11604 | <reponame>michaelrodgers/itc172_final
from django.contrib import admin
from .models import Target, Exercise, Workout
# Register your models here.
admin.site.register(Target)
admin.site.register(Exercise)
admin.site.register(Workout)
| 1.46875 | 1 |
ciclo.py | BeltetonJosue96/Ejercicio3Python | 0 | 11605 | <reponame>BeltetonJosue96/Ejercicio3Python
class Ciclo:
def __init__(self):
self.cicloNew = ()
self.respu = ()
self.a = ()
self.b = ()
self.c = ()
def nuevoCiclo(self):
cicloNew = []
print(" ")
print("Formulario de ingreso de ciclos")
prin... | 4.1875 | 4 |
timeglass.py | mountwebs/timeglass | 110 | 11606 | <filename>timeglass.py
import rumps
import sys
import icon_manager
from datetime import timedelta
import timekeeper
import os
# pyinstaller --onefile -w --add-data "Icons/:Icons" --icon="Icons/timeglass.png" --clean timeglass.spec
# rumps.debug_mode(True)
class TimerApp(rumps.App):
def __init__(self, initial_sec... | 2.421875 | 2 |
example_bot/bot.py | JakeCover/Flare-DiscordPy | 1 | 11607 | import os
from discord.ext.commands import Bot
from Flare import Flare
bot = Bot("~~")
bot.add_cog(Flare(bot))
@bot.command("ping")
async def ping_pong(ctx):
ctx.send("pong")
bot.run(os.environ.get("BOT_TOKEN"))
| 2.3125 | 2 |
utils/logger.py | huangxd-/BTC-ISMIR19 | 82 | 11608 | <reponame>huangxd-/BTC-ISMIR19
import logging
import os
import sys
import time
project_name = os.getcwd().split('/')[-1]
_logger = logging.getLogger(project_name)
_logger.addHandler(logging.StreamHandler())
def _log_prefix():
# Returns (filename, line number) for the stack frame.
def _get_file_line():
... | 2.21875 | 2 |
setup.py | VNOpenAI/OpenControl | 5 | 11609 | import setuptools
ver = {}
with open('OpenControl/_version.py') as fd:
exec(fd.read(), ver)
version = ver.get('__version__')
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="OpenControl",
version=version,
author="VNOpenAI",
author_e... | 1.390625 | 1 |
ismore/plants.py | DerekYJC/bmi_python | 0 | 11610 | '''See the shared Google Drive documentation for an inheritance diagram that
shows the relationships between the classes defined in this file.
'''
import numpy as np
import socket
import time
from riglib import source
from ismore import settings, udp_feedback_client
import ismore_bmi_lib
from utils.constants import *... | 2.53125 | 3 |
catalog/client/services/catalog.py | eoss-cloud/madxxx_catalog_api | 0 | 11611 | <gh_stars>0
#-*- coding: utf-8 -*-
""" EOSS catalog system
functionality for the catalog endpoint
"""
from utilities.web_utils import remote_file_exists
__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2016, EOSS GmbH"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer_... | 2.03125 | 2 |
tests/ui/test_pvc_ui.py | MeridianExplorer/ocs-ci | 0 | 11612 | import logging
import pytest
from ocs_ci.framework.testlib import tier1, skipif_ui_not_support, ui
from ocs_ci.ocs.ui.pvc_ui import PvcUI
from ocs_ci.framework.testlib import skipif_ocs_version
from ocs_ci.framework.pytest_customization.marks import green_squad
from ocs_ci.ocs.resources.pvc import get_all_pvc_objs, ge... | 1.890625 | 2 |
feature_generation/datasets/CSCW.py | s0lvang/ideal-pancake | 6 | 11613 | <reponame>s0lvang/ideal-pancake
import pandas as pd
from feature_generation.datasets.Timeseries import Timeseries
from os.path import basename
class CSCW(Timeseries):
def __init__(self):
super().__init__("cscw")
self.column_name_mapping = {
"id": self.column_names["subject_id"],
... | 2.671875 | 3 |
reactics-smt/rs/reaction_system_with_concentrations.py | arturmeski/reactics | 2 | 11614 | from sys import exit
from colour import *
from rs.reaction_system import ReactionSystem
class ReactionSystemWithConcentrations(ReactionSystem):
def __init__(self):
self.reactions = []
self.meta_reactions = dict()
self.permanent_entities = dict()
self.background_set = []
... | 2.53125 | 3 |
src/models/cnn_train.py | zh272/AIGOGO | 0 | 11615 | <filename>src/models/cnn_train.py
import os
import time
import fire
import torch
import random
import numpy as np
import pandas as pd
import torch.nn.functional as F
## to detach from monitor
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from trainer import Trainer
from model ... | 2.296875 | 2 |
tests/fetchers/test_hvdcLineCktOwnersFetcher.py | rohit98077/mis_outages_ingest | 0 | 11616 | <filename>tests/fetchers/test_hvdcLineCktOwnersFetcher.py
import unittest
from src.fetchers.hvdcLineCktOwnersFetcher import getOwnersForHvdcLineCktIds
import datetime as dt
from src.appConfig import getConfig
class TestHvdcLineCktOwnersFetcher(unittest.TestCase):
appConfig: dict = {}
def setUp(self):
... | 2.859375 | 3 |
3rdParty/boost/1.71.0/libs/python/test/iterator.py | rajeev02101987/arangodb | 12,278 | 11617 | # Copyright <NAME> 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from __future__ import print_function
'''
>>> from iterator_ext import *
>>> from input_iterator import *
>>> x = list_int()
>>> x.push_back(1)
... | 3.109375 | 3 |
py/locationdb/geonames.py | acorg/locationdb | 0 | 11618 | # -*- Python -*-
# license
# license.
# ======================================================================
"""Looks name up in the [geonames database](http://www.geonames.org/).
[GeoNames Search Webservice API](http://www.geonames.org/export/geonames-search.html)
"""
import sys, os, urllib.request, json, time
fro... | 2.515625 | 3 |
python/testData/completion/notImportedQualifiedName/UseImportPriorityWhenAddingImport/main.py | 06needhamt/intellij-community | 0 | 11619 | <reponame>06needhamt/intellij-community
import subprocess
import sys
import django.conf
import django.utils.encoding
subprocess.Popen
sys.argv
plt.<caret> | 1.296875 | 1 |
Array/271EncodeDecodeStrings.py | john-the-dev/leetcode | 0 | 11620 | <reponame>john-the-dev/leetcode
# 271. Encode and Decode Strings
'''
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
Machine 1 (sender) has the function:
string encode(vector<string> strs) {
// ... you... | 3.625 | 4 |
ois_api_client/v2_0/deserialization/deserialize_invoice_number_query.py | peterkulik/ois_api_client | 7 | 11621 | <filename>ois_api_client/v2_0/deserialization/deserialize_invoice_number_query.py
from typing import Optional
import xml.etree.ElementTree as ET
from ...xml.XmlReader import XmlReader as XR
from ..namespaces import API
from ..namespaces import DATA
from ...deserialization.create_enum import create_enum
from ..dto.Invoi... | 2.3125 | 2 |
scripts/markov_rulesets.py | takuyakanbr/covfefe | 0 | 11622 | # Script to generate the necessary grammar rules for the
# markov generator output type
# Dataset:
# http://www.drmaciver.com/2009/12/i-want-one-meelyun-sentences/
import re
ALPHA = ' abcdefghijklmnopqrstuvwxyz'
# read data from file
with open('sentences', 'r', encoding="utf8") as f:
content = f.read().splitlin... | 3.09375 | 3 |
tools/mo/openvino/tools/mo/front/caffe/proposal_ext.py | ryanloney/openvino-1 | 1,127 | 11623 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.common.partial_infer.utils import mo_array
from openvino.tools.mo.ops.proposal import ProposalOp
from openvino.tools.mo.front.caffe.collect_attributes import merge_attrs
from openvino.tools.mo.front.extractor... | 1.804688 | 2 |
mk42/apps/users/migrations/0003_auto_20170614_0038.py | vint21h/mk42 | 5 | 11624 | # -*- coding: utf-8 -*-
# mk42
# mk42/apps/users/migrations/0003_auto_20170614_0038.py
# Generated by Django 1.11.2 on 2017-06-14 00:38
from __future__ import unicode_literals
from django.db import (
migrations,
models,
)
class Migration(migrations.Migration):
dependencies = [
("users", "0002... | 1.65625 | 2 |
utils/datasets.py | LukasStruppek/Plug-and-Play-Attacks | 0 | 11625 | import pickle
import pandas as pd
import torch
import torch.nn as nn
import torchvision.transforms as T
from torch.utils import data
from torch.utils.data import random_split
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.dataset import Dataset
from datasets.celeba import CelebA1000
from dat... | 2.34375 | 2 |
applications/MappingApplication/test_examples/Fluid_SubModelling/MainKratos.py | AndreaVoltan/MyKratos7.0 | 2 | 11626 | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
from KratosMultiphysics import *
from KratosMultiphysics.IncompressibleFluidApplication import *
from KratosMultiphysics.FluidDynamicsApplication import *
from KratosMultiphysics.Exter... | 1.976563 | 2 |
src/ga4gh/vrs/extras/vcf_annotation.py | reece/vmc-python | 1 | 11627 | <reponame>reece/vmc-python<gh_stars>1-10
"""
Annotate VCF files with VRS
Input Format: VCF
Output Format: VCF
The user should pass arguments for the VCF input, VCF output, &
the vrs object file name.
ex. python3 src/ga4gh/vrs/extras/vcf_annotation.py input.vcf.gz --out
./output.vcf.gz --vrs-file ./vrs_objects.pkl
""... | 2.796875 | 3 |
ci/infra/testrunner/utils/utils.py | butsoleg/skuba | 0 | 11628 | <gh_stars>0
import glob
import hashlib
import logging
import os
import shutil
import subprocess
from functools import wraps
from tempfile import gettempdir
from threading import Thread
import requests
from timeout_decorator import timeout
from utils.constants import Constant
from utils.format import Format
logger = ... | 2.140625 | 2 |
nonebot/command/argfilter/controllers.py | EVAyo/nonebot | 676 | 11629 | """
提供几种常用的控制器。
这些验证器通常需要提供一些参数进行一次调用,返回的结果才是真正的验证器,其中的技巧在于通过闭包使要控制的对象能够被内部函数访问。
版本: 1.3.0+
"""
import re
from nonebot import CommandSession
from nonebot.helpers import render_expression
def handle_cancellation(session: CommandSession):
"""
在用户发送 `算了`、`不用了`、`取消吧`、`停` 之类的话的时候,结束当前传入的命令会话(调用 `session.finish(... | 2.734375 | 3 |
hnn_core/dipole.py | chenghuzi/hnn-core | 0 | 11630 | <filename>hnn_core/dipole.py
"""Class to handle the dipoles."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import warnings
import numpy as np
from copy import deepcopy
from .viz import plot_dipole, plot_psd, plot_tfr_morlet
def simulate_dipole(net, tstop, dt=0.025, n_trials=None, record_vsoma=False,
... | 2.515625 | 3 |
openstates/openstates-master/openstates/ga/bills.py | Jgorsick/Advocacy_Angular | 0 | 11631 | <reponame>Jgorsick/Advocacy_Angular
from billy.scrape.bills import BillScraper, Bill
from billy.scrape.votes import Vote
from collections import defaultdict
from .util import get_client, get_url, backoff
# Methods (7):
# GetLegislationDetail(xs:int LegislationId, )
#
# GetLegislationDetai... | 2.40625 | 2 |
data/external/repositories_2to3/267667/kaggle-heart-master/generate_roi_pkl.py | Keesiu/meta-kaggle | 0 | 11632 | import argparse
import numpy as np
import glob
import re
from log import print_to_file
from scipy.fftpack import fftn, ifftn
from skimage.feature import peak_local_max, canny
from skimage.transform import hough_circle
import pickle as pickle
from paths import TRAIN_DATA_PATH, LOGS_PATH, PKL_TRAIN_DATA_PATH, PK... | 1.921875 | 2 |
scrapers/scrapsfbos.py | ndd365/showup | 48 | 11633 | <gh_stars>10-100
import feedparser
from bs4 import BeautifulSoup
from dateutil.parser import parse
from datetime import timedelta
import pytz
from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from oauth2client.service_account import ServiceAccountCredentials
... | 2.875 | 3 |
app/api/v2/models/product.py | danuluma/dannstore | 0 | 11634 | <reponame>danuluma/dannstore<gh_stars>0
import os
import sys
LOCALPATH = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, LOCALPATH + '/../../../../')
from app.api.v2.db import Db
def format_book(book):
"""Formats the results to a dictionary"""
book = {
"id": book[0],
"title": ... | 3.09375 | 3 |
pbq/pbq.py | amirdor/pbq | 0 | 11635 | # -*- coding: utf-8 -*-
"""Main module."""
import os
from google.cloud import bigquery
from pbq.query import Query
from google.cloud import bigquery_storage_v1beta1
from google.cloud.exceptions import NotFound
from google.api_core.exceptions import BadRequest
import pandas as pd
import datetime
class PBQ(object):
... | 3.328125 | 3 |
appvalidator/specprocessor.py | mstriemer/app-validator | 20 | 11636 | import re
import types
from functools import partial
LITERAL_TYPE = types.StringTypes + (int, float, long, bool, )
class Spec(object):
"""
This object, when overridden with an object that implements a file format
specification, will perform validation on a given parsed version of the
format input.
... | 3.265625 | 3 |
head_first_v2/ch4/modules/setup.py | alex-d-bondarev/learn-python | 0 | 11637 | from setuptools import setup
setup(
name='lsearch',
version='1.0',
description='The Head First Python Search Tools', author='<NAME>', author_email='<EMAIL>',
url='headfirstlabs.com',
py_modules=['lsearch'],
)
| 1.054688 | 1 |
desktop_local_tests/windows/test_windows_public_ip_disrupt_reorder_adapters.py | UAEKondaya1/expressvpn_leak_testing | 219 | 11638 | <filename>desktop_local_tests/windows/test_windows_public_ip_disrupt_reorder_adapters.py
from desktop_local_tests.public_ip_during_disruption import PublicIPDuringDisruptionTestCase
from desktop_local_tests.windows.windows_reorder_adapters_disrupter import WindowsReorderAdaptersDisrupter
class TestWindowsPublicIPDisru... | 2.515625 | 3 |
rotkehlchen/api/server.py | rotkehlchenio/rotkehlchen | 137 | 11639 | import json
import logging
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import werkzeug
from flask import Blueprint, Flask, Response, abort, jsonify
from flask.views import MethodView
from flask_cors import CORS
from gevent.pywsgi import WSGIServer
from geventwebsocket i... | 1.390625 | 1 |
stability/stairs_contacts.py | haudren/stability-polygon | 0 | 11640 | import numpy as np
pos = []
normals = []
p = [[-0.4722227, -0.24517583, -0.6370031]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2549828, -0.24587737, -0.63704705]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2... | 1.90625 | 2 |
generator/framework/analyser/analyser.py | sinsay/ds_generator | 0 | 11641 | <reponame>sinsay/ds_generator
import inspect
import re
import types
from collections import namedtuple
from typing import List, Union, Dict
from flask_restplus import fields
from ...common import MetaData, Entry, Arg, ArgSource, RpcType,\
type_def, rpc_doc_args_key, rpc_doc_resp_key, rpc_impl_rename
from ...commo... | 1.945313 | 2 |
bot/helper/mirror_utils/download_utils/telegram_downloader.py | vincreator/Eunha | 0 | 11642 | <filename>bot/helper/mirror_utils/download_utils/telegram_downloader.py
import logging
import random
from time import time
from threading import RLock, Lock, Thread
from bot import LOGGER, download_dict, download_dict_lock, app, STOP_DUPLICATE, STORAGE_THRESHOLD
from bot.helper.ext_utils.bot_utils import get_readable... | 2.171875 | 2 |
setup.py | goofmint/qualityforward-py | 0 | 11643 | import setuptools
setuptools.setup(
name="qualityforward",
version="1.1",
author="<NAME>",
author_email="<EMAIL>",
description="Python library for QualityForward API",
long_description="This is python library for QualityForward API. QualityForward is cloud based test management service.",
... | 1.117188 | 1 |
backend/trips/models.py | repeating/PoputchikiInno | 20 | 11644 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, AbstractUser
from django.utils import timezone
from django.utils.translation import gettext as _
from django import forms
from django.contrib.auth.hashers import make_password
from django.contrib.auth import get_user... | 2.21875 | 2 |
jcs/jcs_main.py | orenmel/lexsub | 26 | 11645 | <reponame>orenmel/lexsub
'''
Run lexical substitution experiments
'''
import sys
import time
import argparse
import re
import numpy
from jcs.jcs_io import extract_word_weight
from jcs.data.context_instance import ContextInstance
from jcs.jcs_io import vec_to_str
from jcs.jcs_io import vec_to_str_gene... | 2.4375 | 2 |
src/django_richenum/__init__.py | adepue/django-richenum | 0 | 11646 | <filename>src/django_richenum/__init__.py
__version__ = 'unknown'
try:
__version__ = __import__('pkg_resources').get_distribution('django_richenum').version
except Exception as e:
pass
| 1.523438 | 2 |
scripts/v.py | NatashaChopper/stage | 0 | 11647 | import numpy
with open ("dic.txt", "w", encoding="utf-8") as dic:
for x in range(5, 790, 1):
if 92 < x <= 113:
dic.write('"'+str(x)+'"'+":"+ '"'+'1'+'",')
elif 113 < x <= 133:
dic.write('"'+str(x)+'"'+":"+ '"'+'2'+'",')
elif 133 < x <= 153:
dic.w... | 2.703125 | 3 |
scrim/globals.py | danbradham/scrim | 4 | 11648 | # -*- coding: utf-8 -*-
'''
=============
scrim.globals
=============
Defines variables passed into the python script via Environment Variables by
scrim scripts. If SCRIM_SHELL is None, then the python script was not executed
by a scrim script.
SHELLS (list): list of available shells
SCRIM_SHELL (str): Parent ... | 2.453125 | 2 |
examples/Api/channels.py | asheshambasta/csound-expression | 0 | 11649 | import csnd6
class Control:
def __init__(self, volume, frequency):
engine = csnd6.Csound()
engine.SetOption("-odac")
engine.Compile("osc.csd")
thread = csnd6.CsoundPerformanceThread(engine)
thread.Play()
self.engine = engine
self.thread = th... | 2.609375 | 3 |
virtual/lib/python3.6/site-packages/isbnlib/_goob.py | david12-wq/PITCHE_APP | 0 | 11650 | <gh_stars>0
# -*- coding: utf-8 -*-
"""Query the Google Books (JSON API v1) service for metadata."""
import logging
from .dev import stdmeta
from .dev._bouth23 import u
from .dev._exceptions import ISBNNotConsistentError, RecordMappingError
from .dev.webquery import query as wquery
UA = 'isbnlib (gzip)'
SERVICE_URL ... | 2.375 | 2 |
gdxpds/test/conftest.py | cdgaete/gdx-pandas | 42 | 11651 | # [LICENSE]
# Copyright (c) 2020, Alliance for Sustainable Energy.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright no... | 1.5 | 2 |
jinahub/indexers/storage/PostgreSQLStorage/tests/test_postgres_dbms.py | Taekyoon/executors | 29 | 11652 | <filename>jinahub/indexers/storage/PostgreSQLStorage/tests/test_postgres_dbms.py
import os
import time
from pathlib import Path
import numpy as np
import pytest
from jina import Document, DocumentArray, Executor, Flow
from jina.logging.profile import TimeContext
from jina_commons.indexers.dump import import_metas, imp... | 1.84375 | 2 |
targhe/models.py | luca772005/studio | 0 | 11653 | from django.db import models
# Create your models here.
class Tipo(models.Model):
descrizione = models.CharField(blank=False, null=False, max_length=128)
def __unicode__(self):
return "{}".format(self.descrizione)
class Meta:
verbose_name_plural = 'Tipi'
class Marca(models.Model):
... | 2.234375 | 2 |
WhatSender/__init__.py | Shauryasamant/whatsender | 1 | 11654 | <filename>WhatSender/__init__.py
from WhatSender.sender import SendMessage
| 1.21875 | 1 |
scenarios/sync_sheets_and_groups.py | Ragnaruk/api_integration | 0 | 11655 | import pickle
from time import sleep
import googleapiclient.errors
from transliterate import translit
from logs.logging import get_logger
from api_google.google_api_sheets import get_sheets_service, get_multiple_ranges
from api_google.google_api_directory import get_directory_service, get_users_for_domain, \
get_... | 2.46875 | 2 |
src/GridCal/Gui/TowerBuilder/gui.py | SanPen/GridCal | 284 | 11656 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'gui.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
######################... | 1.976563 | 2 |
PythonAPI/util/check_lidar_bb.py | inverted-ai/carla | 0 | 11657 | #!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Lidar/BB check for CARLA
This script obtains the LiDAR's point cloud cor... | 2.640625 | 3 |
claim.py | bukovyn/claim | 0 | 11658 | <gh_stars>0
#!/usr/bin/env python3
""" Text files created on DOS/Windows machines have different line endings than
files created on Unix/Linux. DOS uses carriage return and new line ("\r\n")
as a line ending, while Unix uses just new line ("\n"). The purpose of this
script is to have a quick, on the go, sh... | 3.40625 | 3 |
reference/Python/media/moviepy/audio/extract_audio.py | steadylearner/code | 4 | 11659 | import sys
from moviepy.editor import *
clip = VideoFileClip(sys.argv[1])
audioclip = clip.audio
audioclip.write_audiofile(sys.argv[2])
| 2.390625 | 2 |
objettoqt/mixins.py | brunonicko/objettoqt | 0 | 11660 | # -*- coding: utf-8 -*-
"""Mix-in classes for `Qt` types."""
from ._mixins import (
OQAbstractItemModelMixin,
OQAbstractItemViewMixin,
OQObjectMixin,
OQWidgetMixin,
)
from ._views import OQListViewMixin
__all__ = [
"OQObjectMixin",
"OQWidgetMixin",
"OQAbstractItemModelMixin",
"OQAbstra... | 1.15625 | 1 |
util/mccLog.py | ccchooko/webControlClient | 0 | 11661 | <gh_stars>0
#-*-coding:utf8-*-
import logging
from datetime import datetime
class mccLog(object):
def __init__(self):
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
filename= datetime.now(... | 2.796875 | 3 |
Learning-Python/Jumble-Solver/jumble_solver.py | oliverkeen/Sandbox | 0 | 11662 | # <NAME>
# Software Engineering 001
# jumble_solver.py
# 2/17/2021
# Assignment:
# Consider the game "Jumble"
# https://www.sandiegouniontribune.com/sd-jumble-daily-htmlstory.html
# Create a Python program to find the individual words in Jumble puzzles such
# that INJURE prints after entering the following: solve("JNU... | 4.15625 | 4 |
msm/skill_entry.py | luca-vercelli/mycroft-skills-manager | 0 | 11663 | # Copyright (c) 2018 <NAME>, Inc.
#
# This file is part of Mycroft Skills Manager
# (see https://github.com/MycroftAI/mycroft-skills-manager).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional informa... | 1.492188 | 1 |
sleekxmpp/plugins/xep_0027/stanza.py | elrond79/SleekXMPP | 3 | 11664 | <gh_stars>1-10
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 <NAME>, <NAME>
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase
class Signed(ElementBase):
name = 'x'
namespace = 'jabber:x:signed'
plugin_a... | 2.03125 | 2 |
tcptofpc.py | catenacyber/fuzzpcap | 6 | 11665 | #tshark -r input.pcap -qz "follow,tcp,raw,0"
import struct
import sys
import binascii
import subprocess
result = subprocess.Popen( ["tshark", "-r", sys.argv[1], "-qz", "follow,tcp,raw,0"],
stdout=subprocess.PIPE)
sys.stdout.buffer.write(b"FPC\x80")
for i in range(4):
result.stdout.rea... | 2.25 | 2 |
AIJ Filter Collection/AIJ_Night_Filters.py | kjkoeller/BSU-Code | 1 | 11666 | """
Created: November 11, 2020
Author: <NAME>
Python Version 3.9
This program is meant to make the process of collecting the different filters from AIJ excel spreadsheets faster.
The user enters however many nights they have and the program goes through and checks those text files for the
different columns for,HJD, Am... | 4 | 4 |
backend/songwriter/migrations/0006_auto_20170902_0723.py | giliam/turbo-songwriter | 0 | 11667 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-09-02 05:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('songwriter', '0005_auto_20170824_1726'),
]
operations = [
migrations.AlterModelOpti... | 1.53125 | 2 |
util/textbox_utils.py | yannl35133/sslib | 0 | 11668 | CHARACTERS_PER_LINE = 39
def break_lines(text):
chars_in_line = 1
final_text = ''
skip = False
for char in text:
if chars_in_line >= CHARACTERS_PER_LINE:
if char == ' ':
# we happen to be on a space, se we can just break here
final_text += '\n'
... | 3.765625 | 4 |
tools/isolate/data/isolate/with_flag.py | Scopetta197/chromium | 212 | 11669 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
def main():
print 'with_flag: Verify the test data files were mapped properly'
assert len(sys.argv) == 2... | 2.15625 | 2 |
tensorflow/load_mnist.py | stone-zeng/ising | 1 | 11670 | """Loading MNIST dataset.
"""
import struct
import numpy as np
class MNIST:
"""
Loading MNIST dataset.
In the directory of MNIST dataset, there should be the following files:
- Training set:
- train-images-idx3-ubyte
- train-labels-idx1-ubyte
- Test set:
... | 3.8125 | 4 |
sarnet_td3/common/gpu_multithread.py | JingdiC/SARNet | 16 | 11671 | import threading, queue, time, os, pickle
# from queue import Queue
import numpy as np
import tensorflow as tf
import sarnet_td3.common.tf_util as U
from tensorflow.python.keras.backend import set_session
lock = threading.Lock()
class MultiTrainTD3(threading.Thread):
def __init__(self, input_queue, output_queue, ... | 2 | 2 |
Scripts/Miscellaneous/Fake_news_web/app.py | valterm/Python_and_the_Web | 1 | 11672 | from flask import Flask, request, render_template
from sklearn.externals import joblib
from feature import *
pipeline = joblib.load('pipeline.sav')
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/api',methods=['POST'])
def get_delay():
result=request.fo... | 2.546875 | 3 |
1019.next-greater-node-in-linked-list.py | elfgzp/leetCode | 3 | 11673 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def nextLargerNodes(self, head: ListNode) -> List[int]:
nums = []
while head:
nums.append(head.val)
head = head.next
... | 3.71875 | 4 |
WXApi/WXApi/__init__.py | KEDYY/pyweipi | 1 | 11674 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Create: 2014/5/20
Update: 2017/11/22
"""
from .WXError import *
from .WXMenu import *
from .WXUtils import *
from .event import *
from .request import MPCenter
__date__ = '2017/3/12'
__version__ = '1.0.1'
__license__ = 'The MIT License'
| 1.070313 | 1 |
evaluator_package/Parsing_tools.py | MONICA-Project/GOST-tools | 0 | 11675 | def is_field(token):
"""Checks if the token is a valid ogc type field
"""
return token in ["name", "description", "encodingType", "location", "properties", "metadata",
"definition", "phenomenonTime", "resultTime", "observedArea", "result", "id", "@iot.id",
"resultQ... | 3.53125 | 4 |
salt/runners/mine.py | byteskeptical/salt | 12 | 11676 | <gh_stars>10-100
# -*- coding: utf-8 -*-
'''
A runner to access data from the salt mine
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python Libs
import logging
# Import salt libs
import salt.utils.minions
log = logging.getLevelName(__name__)
def get(tgt, fun, tgt_type='glob... | 2.25 | 2 |
app.py | rhedgeco/test_plaid_webapp | 0 | 11677 | from plaid import Client
from backend.link_token import LinkToken
from general_falcon_webserver import WebApp
client = Client(client_id='5e2e3527dd6924001167e8e8', secret='<KEY>', environment='sandbox')
app = WebApp()
app.add_route('link', LinkToken(client))
app.launch_webserver()
| 1.984375 | 2 |
examples/circuitplayground_light_plotter.py | sommersoft/Adafruit_CircuitPython_CircuitPlayground | 0 | 11678 | <reponame>sommersoft/Adafruit_CircuitPython_CircuitPlayground
"""If you're using Mu, this example will plot the light levels from the light sensor (located next
to the eye) on your Circuit Playground. Try shining a flashlight on your Circuit Playground, or
covering the light sensor to see the plot increase and decrease... | 2.953125 | 3 |
kickeststats/exceptions.py | antimaLinux/kickscarper | 0 | 11679 | <filename>kickeststats/exceptions.py<gh_stars>0
"""Exception utilities."""
class ParsingException(Exception):
pass
class EnvVariableNotSet(Exception):
def __init__(self, varname: str) -> None:
super(EnvVariableNotSet, self).__init__(f"Env variable [{varname}] not set.")
class InvalidLineUp(Excepti... | 2.40625 | 2 |
helpers/HurstEstimationNumerics.py | Baozhen-Li/SurfaceTopography | 0 | 11680 | #
# Copyright 2018, 2020 <NAME>
# 2019-2020 <NAME>
# 2015-2016 <NAME>
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including ... | 1.90625 | 2 |
test/serverless_mock_test.py | zhangyuan/serverless-mock-python | 5 | 11681 | import threading
import requests
import json
import os
from nose.tools import *
from server import Httpd
app_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "app")
class TestServerlessMock(object):
def test_ok(self):
ok_(True)
def setUp(self):
self.httpd = Httpd(app_path, 0)... | 2.375 | 2 |
setup.py | holoyan/python-data-validation | 3 | 11682 | <reponame>holoyan/python-data-validation
from setuptools import setup, find_packages
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
na... | 1.835938 | 2 |
bus_system/apps/trip/migrations/0007_auto_20210624_1812.py | pygabo/bus_system | 0 | 11683 | # Generated by Django 3.1.12 on 2021-06-24 18:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('trip', '0006_remove_travelmodel_driver'),
]
operations = [
migrations.AddField(
model_name='tr... | 1.617188 | 2 |
geoscilabs/dcip/DCWidgetPlate2_5D.py | lheagy/geosci-labs | 1 | 11684 | <filename>geoscilabs/dcip/DCWidgetPlate2_5D.py
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
from scipy.constants import epsilon_0
from scipy.ndimage.measurements import center_of_mass
from ipywidgets import IntSlider, FloatSli... | 1.71875 | 2 |
retratodefases/phase_diagrams/__init__.py | Loracio/retrato-de-fases | 3 | 11685 | <gh_stars>1-10
try:
__PHASE_DIAGRAMS_IMPORTED__
except NameError:
__PHASE_DIAGRAMS_IMPORTED__= False
if not __PHASE_DIAGRAMS_IMPORTED__:
from .phase_portrait import PhasePortrait
from .funcion1D import Funcion1D
from .nullclines import Nullcline2D
__PHASE_DIAGRAMS_IMPORTED__ = True | 1.257813 | 1 |
P13pt/spectrumfitter/spectrumfitter.py | green-mercury/P13pt | 3 | 11686 | #!/usr/bin/python
import sys
import os
import shutil
from glob import glob
from PyQt5.QtCore import (Qt, qInstallMessageHandler, QtInfoMsg, QtCriticalMsg, QtDebugMsg,
QtWarningMsg, QtFatalMsg, QSettings, pyqtSlot, QStandardPaths, QUrl)
from PyQt5.QtGui import QIcon, QDesktopServices
from PyQt... | 1.84375 | 2 |
subversion/tests/cmdline/lock_tests.py | centic9/subversion-ppa | 0 | 11687 | <gh_stars>0
#!/usr/bin/env python
# encoding=utf-8
#
# lock_tests.py: testing versioned properties
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Fou... | 1.679688 | 2 |
tests/testresourcemap.py | rayvnekieron/regionator | 0 | 11688 | <reponame>rayvnekieron/regionator
#!/usr/bin/env python
"""
Copyright (C) 2006 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless r... | 1.953125 | 2 |
pycket/base.py | krono/pycket | 0 | 11689 | from pycket.error import SchemeException
from rpython.tool.pairtype import extendabletype
from rpython.rlib import jit, objectmodel
class W_ProtoObject(object):
""" abstract base class of both actual values (W_Objects) and multiple
return values (Values)"""
_attrs_ = []
_settled_ = True
... | 2.515625 | 3 |
src/teacher/flake_approx/teacher_env.py | jainraj/CISR_NeurIPS20 | 16 | 11690 | import numpy as np
from stable_baselines import PPO2
from stable_baselines.common.policies import CnnPolicy
from stable_baselines.a2c.utils import conv, linear, conv_to_fc
from src.envs import CMDP, FrozenLakeEnvCustomMap
from src.envs.frozen_lake.frozen_maps import MAPS
from src.students import LagrangianStudent, i... | 1.609375 | 2 |
scanapi/__init__.py | rajarshig/scanapi | 1 | 11691 | name = "scanapi"
import click
import logging
from scanapi.tree.api_tree import APITree
from scanapi.reporter import Reporter
from scanapi.requests_maker import RequestsMaker
from scanapi.settings import SETTINGS
from scanapi.yaml_loader import load_yaml
@click.command()
@click.option(
"-s",
"--spec-path",
... | 2.15625 | 2 |
breadth first search/level order successor.py | JoanWu5/Grokking-the-coding-interview | 0 | 11692 | <reponame>JoanWu5/Grokking-the-coding-interview<filename>breadth first search/level order successor.py
# Given a binary tree and a node, find the level order successor of the given node in the tree.
# The level order successor is the node that appears right after the given node in the level order traversal.
from coll... | 3.84375 | 4 |
npbench/benchmarks/cavity_flow/cavity_flow_legate.py | frahlg/npbench | 27 | 11693 | <reponame>frahlg/npbench
# Barba, <NAME>., and Forsyth, <NAME>. (2018).
# CFD Python: the 12 steps to Navier-Stokes equations.
# Journal of Open Source Education, 1(9), 21,
# https://doi.org/10.21105/jose.00021
# TODO: License
# (c) 2017 <NAME>, <NAME>.
# All content is under Creative Commons Attribution CC-BY 4.0,
# a... | 2.640625 | 3 |
Lib/gds/burp/config.py | mwielgoszewski/jython-burp-api | 134 | 11694 | <reponame>mwielgoszewski/jython-burp-api
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2007 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are ... | 2.171875 | 2 |
src/Application/PythonScriptModule/pymodules_old/apitest/rotate.py | antont/tundra | 0 | 11695 | <reponame>antont/tundra
import circuits
from PythonQt.QtGui import QQuaternion as Quat
from PythonQt.QtGui import QVector3D as Vec
import naali
COMPNAME = "rotation"
class RotationHandler(circuits.BaseComponent):
def __init__(self, entity=None, comp=None, changetype=None):
circuits.BaseComponent.__init__(... | 2.34375 | 2 |
pyqubo/package_info.py | caja-matematica/pyqubo | 1 | 11696 | <gh_stars>1-10
# (major, minor, patch, prerelease)
VERSION = (0, 0, 6, "")
__shortversion__ = '.'.join(map(str, VERSION[:3]))
__version__ = '.'.join(map(str, VERSION[:3])) + "".join(VERSION[3:])
__package_name__ = 'pyqubo'
__contact_names__ = 'Recruit Communications Co., Ltd.'
__contact_emails__ = '<EMAIL>'
__homepag... | 1.804688 | 2 |
bin/DBImportOperation/etl_operations.py | karlam123/DBImport | 0 | 11697 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1.796875 | 2 |
grvx/nodes/ieeg/read.py | UMCU-RIBS/grvx | 1 | 11698 | <reponame>UMCU-RIBS/grvx
from logging import getLogger
from numpy import mean, std
from pickle import dump
from wonambi import Dataset
from wonambi.trans import math, concatenate
from bidso import Task, Electrodes
lg = getLogger(__name__)
def read_ieeg_block(filename, electrode_file, conditions, minimalduration, out... | 2.09375 | 2 |
bin/analysis/ipa/constraints/split.py | ncbray/pystream | 6 | 11699 | # 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 applicable law or agreed to in writing, softw... | 2.234375 | 2 |