max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
deep_rl/agent/PPO_agent.py | pladosz/MOHQA | 3 | 6632151 | <gh_stars>1-10
#######################################################################
# Copyright (C) 2017 <NAME>(<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
###############################################... | #######################################################################
# Copyright (C) 2017 <NAME>(<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
##############################################################... | de | 0.543062 | ####################################################################### # Copyright (C) 2017 <NAME>(<EMAIL>) # # Permission given to modify the code as long as you keep this # # declaration at the top # ##############################################################... | 1.975337 | 2 |
setup.py | cbrentharris/bricklayer | 0 | 6632152 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='Bricklayer',
version='1.0',
description='Lego Digital Designer Education Tool',
author='<NAME>',
author_email='<EMAIL>',
url='https://bitbucket.org/pbergero/deep-impac',
packages=find_packages(),
entry_points = {
... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='Bricklayer',
version='1.0',
description='Lego Digital Designer Education Tool',
author='<NAME>',
author_email='<EMAIL>',
url='https://bitbucket.org/pbergero/deep-impac',
packages=find_packages(),
entry_points = {
... | ru | 0.26433 | #!/usr/bin/env python | 1.306247 | 1 |
api/files/api/app/generate_csv.py | trackit/trackit-legacy | 2 | 6632153 | import csv
import StringIO
def _get_cost(rgg, name, tag_name, sub_header_name, tagged):
for rg in rgg:
if rg[sub_header_name].lower() == name:
if not tagged:
return rg['cost']
else:
for tagl in rg['tags']:
if tagl['name'] == tag_na... | import csv
import StringIO
def _get_cost(rgg, name, tag_name, sub_header_name, tagged):
for rg in rgg:
if rg[sub_header_name].lower() == name:
if not tagged:
return rg['cost']
else:
for tagl in rg['tags']:
if tagl['name'] == tag_na... | none | 1 | 2.907984 | 3 | |
models/sphere_net_PFE.py | DorisWZG/Probabilistic-Face-Embeddings | 1 | 6632154 | <filename>models/sphere_net_PFE.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import tensorflow as tf
import tensorflow.contrib.slim as slim
model_params = {
'4': ([0, 0, 0, 0], [64, 128, 256, 512]),
'10': ([0, 1, 2, 0], [64, 128, 2... | <filename>models/sphere_net_PFE.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import tensorflow as tf
import tensorflow.contrib.slim as slim
model_params = {
'4': ([0, 0, 0, 0], [64, 128, 256, 512]),
'10': ([0, 1, 2, 0], [64, 128, 2... | en | 0.884501 | # Fix the moving mean and std when training PFE # Output used for PFE | 1.982342 | 2 |
edtslib/opaque_types.py | dartharnold/EDTS | 0 | 6632155 | import json
from .dist import Lightyears
class OpaqEncoder(json.JSONEncoder):
def default(self, obj):
try:
return obj.to_opaq()
except Exception as e:
return "Don't know how to serialise {}: {}".format(type(obj), e)
class Opaq(object):
def __repr__(self):
return str(vars(self))
def to_... | import json
from .dist import Lightyears
class OpaqEncoder(json.JSONEncoder):
def default(self, obj):
try:
return obj.to_opaq()
except Exception as e:
return "Don't know how to serialise {}: {}".format(type(obj), e)
class Opaq(object):
def __repr__(self):
return str(vars(self))
def to_... | none | 1 | 2.680574 | 3 | |
lib/xslt/reader/__init__.py | zepheira/amara | 6 | 6632156 | ########################################################################
# amara/xslt/reader/__init__.py
"""
Classes for the creation of a stylesheet object
"""
import cStringIO
from xml.dom import Node
from xml.sax import SAXParseException
from xml.sax.handler import property_dom_node
from amara import sax
from amar... | ########################################################################
# amara/xslt/reader/__init__.py
"""
Classes for the creation of a stylesheet object
"""
import cStringIO
from xml.dom import Node
from xml.sax import SAXParseException
from xml.sax.handler import property_dom_node
from amara import sax
from amar... | en | 0.655522 | ######################################################################## # amara/xslt/reader/__init__.py Classes for the creation of a stylesheet object # Whitespace stripping rules for a stylesheet: # preserve all whitespace within xsl:text elements; # strip whitespace from all other elements # pseudo-nodes for sa... | 2.439318 | 2 |
tests/onegov/election_day/models/test_subscriber.py | politbuero-kampagnen/onegov-cloud | 0 | 6632157 | from onegov.election_day.models import EmailSubscriber
from onegov.election_day.models import SmsSubscriber
from onegov.election_day.models import Subscriber
def test_subscriber(session):
session.add(Subscriber(address='endpoint', locale='de_CH'))
session.add(EmailSubscriber(address='<EMAIL>', locale='fr_CH')... | from onegov.election_day.models import EmailSubscriber
from onegov.election_day.models import SmsSubscriber
from onegov.election_day.models import Subscriber
def test_subscriber(session):
session.add(Subscriber(address='endpoint', locale='de_CH'))
session.add(EmailSubscriber(address='<EMAIL>', locale='fr_CH')... | none | 1 | 2.394027 | 2 | |
groundup/urls.py | onhan/free-site | 0 | 6632158 | <filename>groundup/urls.py
"""groundup URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.... | <filename>groundup/urls.py
"""groundup URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.... | en | 0.614838 | groundup URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based... | 2.435251 | 2 |
android/deps.bzl | Dig-Doug/rules_proto | 0 | 6632159 | load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load(
"//:deps.bzl",
"build_bazel_rules_android",
"com_google_protobuf",
"com_google_protobuf_lite",
"io_grpc_grpc_java",
)
load(
"//protobuf:deps.bzl",
"protobuf",
)
def com_google_guava_guava_android(**kwarg... | load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load(
"//:deps.bzl",
"build_bazel_rules_android",
"com_google_protobuf",
"com_google_protobuf_lite",
"io_grpc_grpc_java",
)
load(
"//protobuf:deps.bzl",
"protobuf",
)
def com_google_guava_guava_android(**kwarg... | none | 1 | 1.518277 | 2 | |
experiments/voe_mogaze.py | anish-pratheepkumar/anish-pratheepkumar.github.io | 1 | 6632160 | import os
import sys
import click
project_dir = os.path.join(os.path.dirname(__file__), "..")
sys.path.insert(0, project_dir)
os.environ['PATH'] += os.pathsep + project_dir
# -------------------------
from experiments import config
@click.command()
@click.option("--architecture", "-a", help='select one architectur... | import os
import sys
import click
project_dir = os.path.join(os.path.dirname(__file__), "..")
sys.path.insert(0, project_dir)
os.environ['PATH'] += os.pathsep + project_dir
# -------------------------
from experiments import config
@click.command()
@click.option("--architecture", "-a", help='select one architectur... | en | 0.227106 | # ------------------------- # =====================================================RED============================================================== # voc_avg_step_error = 52.050476178331344 # prediction_step | 80 | 160 | 320 | 400 | 600 | 720 | 880... | 2.010335 | 2 |
Exam6-practice/specialNumbers.py | nikolayvutov/Python | 0 | 6632161 | <reponame>nikolayvutov/Python
n = int(input())
for i in range(1, 10):
for j in range(1, 10):
for k in range(1, 10):
for l in range(1, 10):
if n % i == 0 and n % j == 0 and n % k == 0 and n % l == 0:
print('{0}{1}{2}{3}'.format(i, j, k ,l), end=' ') | n = int(input())
for i in range(1, 10):
for j in range(1, 10):
for k in range(1, 10):
for l in range(1, 10):
if n % i == 0 and n % j == 0 and n % k == 0 and n % l == 0:
print('{0}{1}{2}{3}'.format(i, j, k ,l), end=' ') | none | 1 | 3.445095 | 3 | |
vision/camcalib/fusion.py | Photon26/wrs-main-210414 | 0 | 6632162 | import cv2
import math
import yaml
import numpy as np
from cv2 import aruco
from sklearn import cluster
import utiltools.robotmath as rm
from pandaplotutils import pandactrl
def trackobject_multicamfusion(camcaps, cammtxs, camdists, camrelhomos, aruco_dict, arucomarkersize = 100, nframe = 5, denoise = True, bandwidth=... | import cv2
import math
import yaml
import numpy as np
from cv2 import aruco
from sklearn import cluster
import utiltools.robotmath as rm
from pandaplotutils import pandactrl
def trackobject_multicamfusion(camcaps, cammtxs, camdists, camrelhomos, aruco_dict, arucomarkersize = 100, nframe = 5, denoise = True, bandwidth=... | en | 0.572291 | :param camcaps: a list of cv2.VideoCaptures :param cammtxs: a list of mtx for each of the camcaps :param camdists: as list of dist for each of the camcaps :param camrelhomos: a list of relative homogeneous matrices :param aruco_dict: NOTE this is not things like aruco.DICT_6x6_250, instead, it is the re... | 2.262472 | 2 |
HydrothermalCoordination_Metaheuristics/EvolutionaryParticleSwarmOptimization/Functions/mutate.py | anaSilva2018/TryingPy | 0 | 6632163 | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import numpy as np
def _popmut(cpar, nper, mdupl, indxa, indxb):
mmut = np.zeros([indxa, 2*cpar.pop])
munif = np.zeros([indxb, 2*cpar.pop])
mgauss = np.zeros([indxb, 2*cpar.pop])
for i in range(indxb):
for j in range(cpar.pop):
... | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import numpy as np
def _popmut(cpar, nper, mdupl, indxa, indxb):
mmut = np.zeros([indxa, 2*cpar.pop])
munif = np.zeros([indxb, 2*cpar.pop])
mgauss = np.zeros([indxb, 2*cpar.pop])
for i in range(indxb):
for j in range(cpar.pop):
... | en | 0.609409 | # -*- coding: utf-8 -*- @author: <NAME> | 2.051955 | 2 |
crawling_yes24.py | sourcery-ai-bot/github-action-with-python | 0 | 6632164 | <gh_stars>0
import requests
from bs4 import BeautifulSoup
def parsing_beautifulsoup(url):
"""
뷰티풀 수프로 파싱하는 함수
:param url: paring할 URL. 여기선 YES24 Link
:return: BeautifulSoup soup Object
"""
data = requests.get(url)
html = data.text
return BeautifulSoup(html, 'html.parser')
def extra... | import requests
from bs4 import BeautifulSoup
def parsing_beautifulsoup(url):
"""
뷰티풀 수프로 파싱하는 함수
:param url: paring할 URL. 여기선 YES24 Link
:return: BeautifulSoup soup Object
"""
data = requests.get(url)
html = data.text
return BeautifulSoup(html, 'html.parser')
def extract_book_data... | ko | 0.697257 | 뷰티풀 수프로 파싱하는 함수 :param url: paring할 URL. 여기선 YES24 Link :return: BeautifulSoup soup Object BeautifulSoup Object에서 book data를 추출하는 함수 :param soup: BeautifulSoup soup Object :return: contents(str) | 3.505109 | 4 |
test/alignat_tst.py | ikucan/MathsMonkey | 0 | 6632165 | import numpy as np
from pylatex import Document, Section, Subsection, Tabular, Math, TikZ, Axis, \
Plot, Figure, Matrix, Alignat
from pylatex.utils import italic
import os
if __name__ == '__main__':
image_filename = os.path.join(os.path.dirname(__file__), 'kitten.jpg')
geometry_options = {"tmargin": "1cm... | import numpy as np
from pylatex import Document, Section, Subsection, Tabular, Math, TikZ, Axis, \
Plot, Figure, Matrix, Alignat
from pylatex.utils import italic
import os
if __name__ == '__main__':
image_filename = os.path.join(os.path.dirname(__file__), 'kitten.jpg')
geometry_options = {"tmargin": "1cm... | none | 1 | 2.750823 | 3 | |
app/main/models/movies.py | NiHighlism/Minerva | 4 | 6632166 | <reponame>NiHighlism/Minerva
"""
DB Model for Movies table and
relevant junction tables
"""
import datetime
import json
from sqlalchemy.sql import and_, select
from app.main import db, login_manager
from app.main.models.movieSearches import SearchableMixin
class Movie(SearchableMixin, db.Model):
"""
Descrip... | """
DB Model for Movies table and
relevant junction tables
"""
import datetime
import json
from sqlalchemy.sql import and_, select
from app.main import db, login_manager
from app.main.models.movieSearches import SearchableMixin
class Movie(SearchableMixin, db.Model):
"""
Description of User model.
Colum... | en | 0.481977 | DB Model for Movies table and relevant junction tables Description of User model. Columns ----------- :id: int [pk] :user_id: int [Foreign Key -> User.id] :imdb_ID: varchar(128) [not NULL] :title: Text [not NULL] :year: int :release_date: DateTime :runtime: int :genre: JSON :... | 2.994666 | 3 |
usr/share/pyshared/ajenti/plugins/network/api.py | lupyuen/RaspberryPiImage | 7 | 6632167 | import psutil
from ajenti.api import *
from ajenti.ui import *
@plugin
class NetworkManager (BasePlugin):
def get_devices(self):
return psutil.net_io_counters(pernic=True).keys()
@interface
class INetworkConfig (object):
interfaces = {}
@property
def interface_list(self):
return se... | import psutil
from ajenti.api import *
from ajenti.ui import *
@plugin
class NetworkManager (BasePlugin):
def get_devices(self):
return psutil.net_io_counters(pernic=True).keys()
@interface
class INetworkConfig (object):
interfaces = {}
@property
def interface_list(self):
return se... | none | 1 | 1.979867 | 2 | |
qdmr_parsing/model/rule_based/rule_based_model.py | justeuer/Break | 38 | 6632168 | <filename>qdmr_parsing/model/rule_based/rule_based_model.py
import re
from model.rule_based.decompose_rules import *
from model.model_base import ModelBase
class RuleBasedModel(ModelBase):
def __init__(self):
super(RuleBasedModel, self).__init__()
self.prefixes_to_remove = ["what is", "what are"... | <filename>qdmr_parsing/model/rule_based/rule_based_model.py
import re
from model.rule_based.decompose_rules import *
from model.model_base import ModelBase
class RuleBasedModel(ModelBase):
def __init__(self):
super(RuleBasedModel, self).__init__()
self.prefixes_to_remove = ["what is", "what are"... | en | 0.911877 | # TODO: consider keeping question marks, which improve tagger accuracy # (e.g. "Where did the illustrator of \"De Divina Proportione\" die?"). Simplify the question by removing extra unnecessary parts of it, if exist. # extract mention-reference sentence pairs # in case there is no coref, treat the text as a single se... | 2.713692 | 3 |
venv/Lib/site-packages/pygame/tests/image__save_gl_surface_test.py | ZenithEmber/COMP120-Assignment-1-contract | 46 | 6632169 | import os
import unittest
from pygame.tests import test_utils
import pygame
from pygame.locals import *
@unittest.skipIf(os.environ.get('SDL_VIDEODRIVER') == 'dummy',
'OpenGL requires a non-"dummy" SDL_VIDEODRIVER')
class GL_ImageSave(unittest.TestCase):
def test_image_save_works_with_opengl_sur... | import os
import unittest
from pygame.tests import test_utils
import pygame
from pygame.locals import *
@unittest.skipIf(os.environ.get('SDL_VIDEODRIVER') == 'dummy',
'OpenGL requires a non-"dummy" SDL_VIDEODRIVER')
class GL_ImageSave(unittest.TestCase):
def test_image_save_works_with_opengl_sur... | en | 0.341557 | |tags:display,slow,opengl| # Try the imageext module. # Only test the image module. # stops tonnes of tmp dirs building up in trunk dir | 2.451428 | 2 |
plugin/references.py | kaste/LSP | 0 | 6632170 | import os
import sublime
import linecache
from .core.panels import ensure_panel
from .core.protocol import Request, Point
from .core.registry import get_position
from .core.registry import LspTextCommand
from .core.registry import windows
from .core.settings import PLUGIN_NAME
from .core.settings import userprefs
from... | import os
import sublime
import linecache
from .core.panels import ensure_panel
from .core.protocol import Request, Point
from .core.registry import get_position
from .core.registry import LspTextCommand
from .core.registry import windows
from .core.settings import PLUGIN_NAME
from .core.settings import userprefs
from... | en | 0.800215 | # type: List[List[str]] # type: Optional[sublime.Region] # type: Optional[str] # use relative paths if file on the same root. # return if there are no references # pre-select a reference in the current file. # append a new line after each file name # highlight all word occurrences Return a dictionary that groups refere... | 1.95289 | 2 |
tensorimage/util/system/mkdir.py | Nesac128/tensorimage | 19 | 6632171 | <gh_stars>10-100
import os
def mkdir(dir_path):
if not os.path.exists(dir_path):
os.mkdir(dir_path)
| import os
def mkdir(dir_path):
if not os.path.exists(dir_path):
os.mkdir(dir_path) | none | 1 | 2.580427 | 3 | |
VolumeToMesh/VolumeToMesh.py | lassoan/SlicerMorph | 0 | 6632172 | <reponame>lassoan/SlicerMorph
import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import fnmatch
import numpy as np
import random
import math
#
# VolumeToMesh
#
class VolumeToMesh(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, availa... | import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import fnmatch
import numpy as np
import random
import math
#
# VolumeToMesh
#
class VolumeToMesh(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com... | en | 0.780295 | # # VolumeToMesh # Uses ScriptedLoadableModule base class, available at: https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/ScriptedLoadableModule.py # TODO make this more human readable by adding spaces # replace with "Firstname Lastname (Organization)" This module takes a directory of volumes and seg... | 2.240111 | 2 |
week6-Evasion/bot/random_player.py | chirag1992m/heuristicProblemSolvingFall17 | 0 | 6632173 | import argparse
from .base_bot import BaseBot
import random
class RandomBot(BaseBot):
def __init__(self, host, port, name, visualize=False, seed=42):
super().__init__(host=host, port=port, name=name, visualize=visualize)
random.seed(seed)
def move_hunter(self):
wall = random.randint(... | import argparse
from .base_bot import BaseBot
import random
class RandomBot(BaseBot):
def __init__(self, host, port, name, visualize=False, seed=42):
super().__init__(host=host, port=port, name=name, visualize=visualize)
random.seed(seed)
def move_hunter(self):
wall = random.randint(... | none | 1 | 2.863017 | 3 | |
aumento de salario .py | Danielporcela/Meus-exercicios-phyton | 2 | 6632174 | <filename>aumento de salario .py<gh_stars>1-10
salario = float(input('Qual é o salario do funcionario ? R$ '))
aumento = salario + (salario *15 / 100)
print(' Um funcionario que ganhava R$ {:.2f}, com aumento de 15 % passa a receber R$ {:.2f} '.format(salario,aumento ))
| <filename>aumento de salario .py<gh_stars>1-10
salario = float(input('Qual é o salario do funcionario ? R$ '))
aumento = salario + (salario *15 / 100)
print(' Um funcionario que ganhava R$ {:.2f}, com aumento de 15 % passa a receber R$ {:.2f} '.format(salario,aumento ))
| none | 1 | 3.587743 | 4 | |
examples/misc/h2o2_ilt.py | amatsugi/me2d | 0 | 6632175 | #! /usr/bin/env python3
"""
ILT (inverse laplace transform) calculation of k(E) for H2O2 => OH + OH
output file: h2o2_iltE_dE10.dat
"""
from me2d import RoVib
from me2d import ilt
nsym = 2
rotA = 10.3560
rotB2D = 0.84680
freq = [877, 1266, 1402, 3599, 3608]
# HO-OH rotational energy levels
levels = [0.0, 13.28417, 2... | #! /usr/bin/env python3
"""
ILT (inverse laplace transform) calculation of k(E) for H2O2 => OH + OH
output file: h2o2_iltE_dE10.dat
"""
from me2d import RoVib
from me2d import ilt
nsym = 2
rotA = 10.3560
rotB2D = 0.84680
freq = [877, 1266, 1402, 3599, 3608]
# HO-OH rotational energy levels
levels = [0.0, 13.28417, 2... | en | 0.506519 | #! /usr/bin/env python3 ILT (inverse laplace transform) calculation of k(E) for H2O2 => OH + OH output file: h2o2_iltE_dE10.dat # HO-OH rotational energy levels # ILT [k(T) = A*exp(-E/RT)] # s^-1 # cm^-1 | 2.407072 | 2 |
src/selena/stats/migrations/0002_auto__add_field_incident_incident_type.py | deejay1/selena | 23 | 6632176 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Incident.incident_type'
db.add_column(u'stats_incident', 'incident_type',
... | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Incident.incident_type'
db.add_column(u'stats_incident', 'incident_type',
... | en | 0.530649 | # -*- coding: utf-8 -*- # Adding field 'Incident.incident_type' # Deleting field 'Incident.incident_type' | 2.176739 | 2 |
Club_Performance_BenjaminMeco_Final.py | jesperiksson/SoccermaticsForPython | 0 | 6632177 | <reponame>jesperiksson/SoccermaticsForPython<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 10:35:12 2020
@author: BenjaminMeco
"""
import matplotlib.pyplot as plt
import numpy as np
import json
import pandas as pd
from pandas import json_normalize
from FCPython import createPitch... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 10:35:12 2020
@author: BenjaminMeco
"""
import matplotlib.pyplot as plt
import numpy as np
import json
import pandas as pd
from pandas import json_normalize
from FCPython import createPitch
import statsmodels.formula.api as smf
def factorial(n)... | en | 0.863498 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Sun Oct 25 10:35:12 2020 @author: BenjaminMeco # this is just a help for getting the data # for getting the distributions: # this makes a simulation using weights as the probability distribution # do a simulation: # get the placements: #Load the data # first we... | 3.273476 | 3 |
Py57/main.py | xhexe/Py8R | 0 | 6632178 | <gh_stars>0
def longest_word(file):
with open(file, "r") as f:
words = f.read().split()
longest_word = len(max(words, key=len))
return [word for word in words if len(word) == longest_word]
print(longest_word("/home/xhexe/Py/Py8R/files/text.txt"))
| def longest_word(file):
with open(file, "r") as f:
words = f.read().split()
longest_word = len(max(words, key=len))
return [word for word in words if len(word) == longest_word]
print(longest_word("/home/xhexe/Py/Py8R/files/text.txt")) | none | 1 | 4.161389 | 4 | |
turb2d/cip.py | narusehajime/turb2d | 0 | 6632179 | import numpy as np
def cip_2d_M_advection(
f,
dfdx,
dfdy,
u,
v,
core,
h_up,
v_up,
dx,
dt,
out_f=None,
out_dfdx=None,
out_dfdy=None,
):
"""Calculate one time step using M-type 2D cip method
"""
# First, the variables out and temp are allocated to
# s... | import numpy as np
def cip_2d_M_advection(
f,
dfdx,
dfdy,
u,
v,
core,
h_up,
v_up,
dx,
dt,
out_f=None,
out_dfdx=None,
out_dfdy=None,
):
"""Calculate one time step using M-type 2D cip method
"""
# First, the variables out and temp are allocated to
# s... | en | 0.59521 | Calculate one time step using M-type 2D cip method # First, the variables out and temp are allocated to # store the calculation results # 1st step for horizontal advection # 2nd step for vertical advection Calculate one time step using M-type 2D cip method # First, the variables out and temp are allocated to # store th... | 3.052096 | 3 |
cortex/secondary/entropy.py | dcurrey88/LAMP-cortex | 0 | 6632180 | <gh_stars>0
from ..feature_types import secondary_feature, log
from ..primary.significant_locations import significant_locations
MS_IN_A_DAY = 86400000
@secondary_feature(
name='cortex.feature.entropy',
dependencies=[significant_locations]
)
def entropy(resolution=MS_IN_A_DAY, **kwargs):
"""
Calculate ... | from ..feature_types import secondary_feature, log
from ..primary.significant_locations import significant_locations
MS_IN_A_DAY = 86400000
@secondary_feature(
name='cortex.feature.entropy',
dependencies=[significant_locations]
)
def entropy(resolution=MS_IN_A_DAY, **kwargs):
"""
Calculate entropy
... | en | 0.340194 | Calculate entropy #log.info(f'Loading significant locations data...') #log.info(f'Computing entropy...') #no sig locs | 2.570448 | 3 |
mne/io/artemis123/tests/test_artemis123.py | slew/mne-python | 0 | 6632181 |
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import pytest
from mne.io import read_raw_artemis123
from mne.io.tests.test_raw import _test_raw_reader
from mne.datasets import testing
from mne.io.artemis123.utils... |
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import pytest
from mne.io import read_raw_artemis123
from mne.io.tests.test_raw import _test_raw_reader
from mne.datasets import testing
from mne.io.artemis123.utils... | en | 0.813608 | # Author: <NAME> <<EMAIL>> # # License: BSD (3-clause) # XXX this tol is way too high, but it's not clear which is correct # (old or new) # ~25 sec on Travis Linux OpenBLAS Test reading raw Artemis123 files. Test dev_head_t computation for Artemis123. # test a random selected point # checked against matlab reader. # te... | 1.766914 | 2 |
server/athenian/api/controllers/datetime_utils.py | athenianco/athenian-api | 9 | 6632182 | from datetime import date, datetime, timedelta, timezone
from typing import List, Optional, Tuple, Union
from athenian.api.models.web import Granularity, InvalidRequestError
from athenian.api.response import ResponseError
def coarsen_time_interval(time_from: datetime, time_to: datetime) -> Tuple[date, date]:
"""... | from datetime import date, datetime, timedelta, timezone
from typing import List, Optional, Tuple, Union
from athenian.api.models.web import Granularity, InvalidRequestError
from athenian.api.response import ResponseError
def coarsen_time_interval(time_from: datetime, time_to: datetime) -> Tuple[date, date]:
"""... | en | 0.718588 | Extend the time interval to align at the date boarders. Produce time interval boundaries from the min and the max dates and the interval lengths \ (granularities). :param tzoffset: Time zone offset in minutes. We ignore DST for now. :return: tuple with the time intervals and the timezone offset converted t... | 2.696744 | 3 |
binreconfiguration/strategy/gauge/count.py | vialette/binreconfiguration | 0 | 6632183 | """Count gauge"""
from .gauge import Gauge
class Count(Gauge):
def __call__(self, t):
"""Return the number of items in a bin (including the requested one)."""
(_, bin) = t
return bin.count() + 1 | """Count gauge"""
from .gauge import Gauge
class Count(Gauge):
def __call__(self, t):
"""Return the number of items in a bin (including the requested one)."""
(_, bin) = t
return bin.count() + 1 | en | 0.893536 | Count gauge Return the number of items in a bin (including the requested one). | 3.035648 | 3 |
dakara_server/library/tests/test_song_tag.py | DakaraProject/dakara-server | 4 | 6632184 | from django.urls import reverse
from rest_framework import status
from internal.tests.base_test import UserModel
from library.models import SongTag
from library.tests.base_test import LibraryAPITestCase
class SongTagListViewTestCase(LibraryAPITestCase):
url = reverse("library-songtag-list")
def setUp(self):... | from django.urls import reverse
from rest_framework import status
from internal.tests.base_test import UserModel
from library.models import SongTag
from library.tests.base_test import LibraryAPITestCase
class SongTagListViewTestCase(LibraryAPITestCase):
url = reverse("library-songtag-list")
def setUp(self):... | en | 0.788675 | # create a manager # create a user without any rights # create test data Test to verify tag list. # Login as simple user # Get tags list # Tags are sorted by name Test to verify unauthenticated user can't get tag list. # Attempt to get work type list Test to create a tag when it already exists. # Login as simple user #... | 2.554426 | 3 |
trace_event/etw_manifest/BUILD/message_compiler.py | chinmaygarde/flutter_base | 20 | 6632185 | <filename>trace_event/etw_manifest/BUILD/message_compiler.py
# 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.
# Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the
# GN build, which... | <filename>trace_event/etw_manifest/BUILD/message_compiler.py
# 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.
# Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the
# GN build, which... | en | 0.888763 | # 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. # Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the # GN build, which can only run Python and not native binaries. # mc writes to s... | 1.890278 | 2 |
spotui/src/SearchInput.py | ssiyad/spotui | 410 | 6632186 | import curses
from spotui.src.util import truncate
from spotui.src.input import Input
from spotui.src.component import Component
class SearchInput(Component):
def __init__(self, stdscr, api, handle_search):
self.stdscr = stdscr
self.api = api
self.handle_search = handle_search
self... | import curses
from spotui.src.util import truncate
from spotui.src.input import Input
from spotui.src.component import Component
class SearchInput(Component):
def __init__(self, stdscr, api, handle_search):
self.stdscr = stdscr
self.api = api
self.handle_search = handle_search
self... | none | 1 | 2.488842 | 2 | |
vollseg/spatial_image.py | Kapoorlabs-CAPED/CAPED-VollSeg | 7 | 6632187 | # -*- python -*-
#
# spatial_image: spatial nd images
#
# Copyright 2006 INRIA - CIRAD - INRA
#
# File author(s): <NAME> <<EMAIL>>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.h... | # -*- python -*-
#
# spatial_image: spatial nd images
#
# Copyright 2006 INRIA - CIRAD - INRA
#
# File author(s): <NAME> <<EMAIL>>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.h... | en | 0.577009 | # -*- python -*- # # spatial_image: spatial nd images # # Copyright 2006 INRIA - CIRAD - INRA # # File author(s): <NAME> <<EMAIL>> # # Distributed under the Cecill-C License. # See accompanying file LICENSE.txt or copy at # http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.h... | 2.668311 | 3 |
snippets/math/digit.py | KATO-Hiro/Somen-Soupy | 1 | 6632188 | # -*- coding: utf-8 -*-
def count_digit(max_number: int) -> int:
'''
Args:
max_number: Int of number (greater than 1).
Returns:
the number of digit.
Landau notation: O(log n)
'''
if max_number == 0:
return 1
digit = 0
while max_number:
... | # -*- coding: utf-8 -*-
def count_digit(max_number: int) -> int:
'''
Args:
max_number: Int of number (greater than 1).
Returns:
the number of digit.
Landau notation: O(log n)
'''
if max_number == 0:
return 1
digit = 0
while max_number:
... | en | 0.659243 | # -*- coding: utf-8 -*- Args:
max_number: Int of number (greater than 1).
Returns:
the number of digit.
Landau notation: O(log n) | 3.993526 | 4 |
learning-flask/application.py | eduardoc7/edx_python_javascript | 1 | 6632189 | from flask import Flask, render_template, request, session
from flask_session import Session
app = Flask(__name__)
notes = list()
# Aplicação para receber um formulário e adicionar a uma lista de notas,
# que será exibida na tela
# Main Program
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = 'fil... | from flask import Flask, render_template, request, session
from flask_session import Session
app = Flask(__name__)
notes = list()
# Aplicação para receber um formulário e adicionar a uma lista de notas,
# que será exibida na tela
# Main Program
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = 'fil... | pt | 0.994828 | # Aplicação para receber um formulário e adicionar a uma lista de notas, # que será exibida na tela # Main Program | 3.311467 | 3 |
python/perspective/perspective/tests/table/test_remove.py | willium/perspective | 0 | 6632190 | # *****************************************************************************
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from perspective.table import... | # *****************************************************************************
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from perspective.table import... | en | 0.76268 | # ***************************************************************************** # # Copyright (c) 2019, the Perspective Authors. # # This file is part of the Perspective library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # | 2.415083 | 2 |
main/urls.py | dera1992/blog_tutorial | 0 | 6632191 | app_name = "main"
urlpatterns = [ ]
| app_name = "main"
urlpatterns = [ ]
| none | 1 | 1.023896 | 1 | |
kstore/migrations/0013_auto_20160215_1028.py | KeoH/django-keoh-kstore | 0 | 6632192 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('kstore', '0012_basicconfiguration_theme'),
]
operations = [
migrations... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('kstore', '0012_basicconfiguration_theme'),
]
operations = [
migrations... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.667571 | 2 |
client/commands/tests/start_test.py | aspin/pyre-check | 0 | 6632193 | <filename>client/commands/tests/start_test.py
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import errno
import fcntl
import unittest
from unittest.mock import MagicMock, call, mock_open, patch
... | <filename>client/commands/tests/start_test.py
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import errno
import fcntl
import unittest
from unittest.mock import MagicMock, call, mock_open, patch
... | en | 0.819658 | # Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # noqa # noqa # Check start without watchman. # This magic is necessary to test, because the inner call to ping a server is # always non-blocking. # ... | 2.083856 | 2 |
evaluation_cyclegan/test.py | samxuxiang/mcmi | 3 | 6632194 | import torch
from options.test_options import TestOptions
from dataset import dataset_single
from saver import save_imgs
import os
import inception_utils
from inception import InceptionV3
import numpy as np
import glob
from models import create_model
import modelss
import torchvision
def compute_lpips(imgs, model_ale... | import torch
from options.test_options import TestOptions
from dataset import dataset_single
from saver import save_imgs
import os
import inception_utils
from inception import InceptionV3
import numpy as np
import glob
from models import create_model
import modelss
import torchvision
def compute_lpips(imgs, model_ale... | en | 0.619141 | # parse options # test code only supports num_threads = 1 # test code only supports batch_size = 1 # disable data shuffling; comment this line if results on randomly chosen images are needed. # no flip; comment this line if results on flipped images are needed. # no visdom display; the test code saves the results to a ... | 2.158939 | 2 |
api/v1/app.py | Theemiss/Quick_Report | 4 | 6632195 | <gh_stars>1-10
from flask import Flask, make_response, jsonify
from datetime import timedelta
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
from flask_cors import CORS
from flask_migrate import Migrate
from flask_restful_swagger import swagger
from doten... | from flask import Flask, make_response, jsonify
from datetime import timedelta
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
from flask_cors import CORS
from flask_migrate import Migrate
from flask_restful_swagger import swagger
from dotenv import dotenv... | en | 0.733972 | Global File Config And Route api instance # swagger Init #path to your wkhtmltopdf installation. #app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True #Token Time Auto Revoke # Enable Token Blocklist #Type of Token db table for the jwt token Blocklist # Callback function to check if a JWT exists in the database blocklist C... | 2.015714 | 2 |
validations/argsparser.py | binary-hideout/p-dispersion-problem | 1 | 6632196 | '''
Validations for inputs from the command-line argument parsers.
'''
from argparse import ArgumentTypeError
from typing import Tuple
from .numerical import is_float, is_int
def is_valid_n(string: str) -> int:
'''
If the string parameter represents a valid value for 'n' returns its value,
otherwise rais... | '''
Validations for inputs from the command-line argument parsers.
'''
from argparse import ArgumentTypeError
from typing import Tuple
from .numerical import is_float, is_int
def is_valid_n(string: str) -> int:
'''
If the string parameter represents a valid value for 'n' returns its value,
otherwise rais... | en | 0.269757 | Validations for inputs from the command-line argument parsers. If the string parameter represents a valid value for 'n' returns its value, otherwise raises ArgumentTypeError exception. If the string parameter represents a valid decimal percentage returns its value, otherwise raises ArgumentTypeError exception. ... | 4.097856 | 4 |
client/over-the-rainbow/over-the-rainbow-client.py | GamesCreatorsClub/GCC-Rover | 3 | 6632197 | <filename>client/over-the-rainbow/over-the-rainbow-client.py
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import sys
import time
import pygame
import pyros
import pyros.gcc
import pyros.gccui
import pyros.agent
import pyros.pygamehelper
from PIL import Image
MAX_PING_TIMEOUT = 1
MAX_PICTURES = 400
... | <filename>client/over-the-rainbow/over-the-rainbow-client.py
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import sys
import time
import pygame
import pyros
import pyros.gcc
import pyros.gccui
import pyros.agent
import pyros.pygamehelper
from PIL import Image
MAX_PING_TIMEOUT = 1
MAX_PICTURES = 400
... | en | 0.484584 | # # Copyright 2016-2017 Games Creators Club # # MIT License # # if "red" in result: # drawTarget(image, result["red"], pyros.gccui.RED, "red") # if "green" in result: # drawTarget(image, result["green"], pyros.gccui.GREEN, "green") # if "yellow" in result: # drawTarget(image, result["yellow"], pyros.gccui.Y... | 2.421881 | 2 |
cpppm/conans.py | Garcia6l20/cpppm | 3 | 6632198 | import asyncio
from pathlib import Path
from conans import ConanFile as ConanConanFile
from conans import tools
from cpppm import Project, Library, root_project
import nest_asyncio
nest_asyncio.apply()
class PackageInfos:
def __init__(self, data):
self.include_dirs = set()
self.lib_dirs = set(... | import asyncio
from pathlib import Path
from conans import ConanFile as ConanConanFile
from conans import tools
from cpppm import Project, Library, root_project
import nest_asyncio
nest_asyncio.apply()
class PackageInfos:
def __init__(self, data):
self.include_dirs = set()
self.lib_dirs = set(... | en | 0.547831 | # for dep in self._infos.deps: # self.link_libraries = Project._pkg_libraries[dep] # url = project.url | 2.184102 | 2 |
engfrosh_site/frosh/migrations/0013_alter_userdetails_invite_email_sent.py | engfrosh/engfrosh | 1 | 6632199 | # Generated by Django 3.2.5 on 2021-09-03 01:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frosh', '0012_userdetails_invite_email_sent'),
]
operations = [
migrations.AlterField(
model_name='userdetails',
nam... | # Generated by Django 3.2.5 on 2021-09-03 01:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frosh', '0012_userdetails_invite_email_sent'),
]
operations = [
migrations.AlterField(
model_name='userdetails',
nam... | en | 0.864762 | # Generated by Django 3.2.5 on 2021-09-03 01:17 | 1.429134 | 1 |
cardclass.py | sackidude/2048-solitaire | 1 | 6632200 | <reponame>sackidude/2048-solitaire<filename>cardclass.py
"""This is all the classes. card, piles and hand"""
from random import randrange
import funcs
INVALID_INPUT = 2
class NonRenderGame:
"""This is the whole game class without any rendering."""
def __init__(self, max_cards):
self.hand = NonRender... | """This is all the classes. card, piles and hand"""
from random import randrange
import funcs
INVALID_INPUT = 2
class NonRenderGame:
"""This is the whole game class without any rendering."""
def __init__(self, max_cards):
self.hand = NonRenderHand()
self.piles = NonRenderPiles()
self... | en | 0.884638 | This is all the classes. card, piles and hand This is the whole game class without any rendering. Initiate the hand with two cards This function takes a number between 0-3 and places a card there if it can. It return true if it placed a card. This is only used in the msachine learning part of the progra... | 3.882328 | 4 |
LeetCode/0076_minimum_window_substring.py | KanegaeGabriel/ye-olde-interview-prep-grind | 1 | 6632201 | <gh_stars>1-10
def countChars(s):
count = [0 for _ in range(256)]
for c in s:
count[ord(c)] += 1
return count
def minWindow(s, t):
tCount = countChars(t)
i, j = 0, 0
sCount = [0 for _ in range(256)]
best = [None, i, j]
while i <= j and j < len(s):
sCount[ord(s[j])] += ... | def countChars(s):
count = [0 for _ in range(256)]
for c in s:
count[ord(c)] += 1
return count
def minWindow(s, t):
tCount = countChars(t)
i, j = 0, 0
sCount = [0 for _ in range(256)]
best = [None, i, j]
while i <= j and j < len(s):
sCount[ord(s[j])] += 1
whil... | en | 0.486913 | # "BANC" # "" | 3.240774 | 3 |
database_files/hr_naselja_gradovi/izvezi_hr_naselja_u_csv.py | mvrban123/PHP-Laravel-Project---Website | 0 | 6632202 | <filename>database_files/hr_naselja_gradovi/izvezi_hr_naselja_u_csv.py<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# **Dataset from: https://www.posta.hr/preuzimanje-podataka-o-postanskim-uredima-6543/6543**
import pandas as pd
target_cols = [
"BrojPu",
"Naselje"
]
df_mjesta = pd.read_excel("./mjestaRh.... | <filename>database_files/hr_naselja_gradovi/izvezi_hr_naselja_u_csv.py<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# **Dataset from: https://www.posta.hr/preuzimanje-podataka-o-postanskim-uredima-6543/6543**
import pandas as pd
target_cols = [
"BrojPu",
"Naselje"
]
df_mjesta = pd.read_excel("./mjestaRh.... | en | 0.322035 | #!/usr/bin/env python # coding: utf-8 # **Dataset from: https://www.posta.hr/preuzimanje-podataka-o-postanskim-uredima-6543/6543** # df_mjesta | 2.417385 | 2 |
test/func_test/test_ctrt/test_pay_chan_ctrt.py | josephzxy/py-vsys | 1 | 6632203 | <filename>test/func_test/test_ctrt/test_pay_chan_ctrt.py
import asyncio
import time
from typing import Tuple
import pytest
import py_vsys as pv
from test.func_test import conftest as cft
class TestPayChanCtrt:
"""
TestPayChanCtrt is the collection of functional tests of Payment Channel Contract.
"""
... | <filename>test/func_test/test_ctrt/test_pay_chan_ctrt.py
import asyncio
import time
from typing import Tuple
import pytest
import py_vsys as pv
from test.func_test import conftest as cft
class TestPayChanCtrt:
"""
TestPayChanCtrt is the collection of functional tests of Payment Channel Contract.
"""
... | en | 0.61532 | TestPayChanCtrt is the collection of functional tests of Payment Channel Contract. new_tok_ctrt is the fixture that registers a new token contract without split instance. Args: acnt0 (pv.Account): The account of nonce 0. Returns: pv.TokCtrtWithoutSplit: The token contract insta... | 2.444988 | 2 |
cfgov/data_research/tests/test_views.py | thephillipsequation/cfgov-refresh | 0 | 6632204 | import datetime
import json
import unittest
import django
from django.core.urlresolvers import NoReverseMatch, reverse
from model_bakery import baker
from data_research.models import (
County, CountyMortgageData, MetroArea, MSAMortgageData,
NationalMortgageData, NonMSAMortgageData, State, StateMortgageData
)... | import datetime
import json
import unittest
import django
from django.core.urlresolvers import NoReverseMatch, reverse
from model_bakery import baker
from data_research.models import (
County, CountyMortgageData, MetroArea, MSAMortgageData,
NationalMortgageData, NonMSAMortgageData, State, StateMortgageData
)... | en | 0.811758 | check the year_month validator The view should deliver a below-threshold MSA with value of None Should deliver a below-threshold non-MSA with value of None | 2.475304 | 2 |
gdutils/datamine.py | InnovativeInventor/gdutils | 0 | 6632205 | """
gdutils.datamine
================
Provides
- A ``python`` module for mining and listing data sources.
Metadata
--------
:Module: ``gdutils.datamine``
:Filename: `datamine.py <https://github.com/mggg/gdutils/>`_
:Author: `@KeiferC <https://github.com/keiferc>`_
:Date: 27 July 2020
:... | """
gdutils.datamine
================
Provides
- A ``python`` module for mining and listing data sources.
Metadata
--------
:Module: ``gdutils.datamine``
:Filename: `datamine.py <https://github.com/mggg/gdutils/>`_
:Author: `@KeiferC <https://github.com/keiferc>`_
:Date: 27 July 2020
:... | en | 0.594174 | gdutils.datamine ================ Provides - A ``python`` module for mining and listing data sources. Metadata -------- :Module: ``gdutils.datamine`` :Filename: `datamine.py <https://github.com/mggg/gdutils/>`_ :Author: `@KeiferC <https://github.com/keiferc>`_ :Date: 27 July 2020 :Vers... | 2.506256 | 3 |
examples/example_ocr.py | Ichunjo/vardefunc | 18 | 6632206 | <reponame>Ichunjo/vardefunc<filename>examples/example_ocr.py
import vapoursynth as vs
from vardefunc.ocr import OCR
from vsutil import get_y
core = vs.core
# Import your clip
SOURCE = core.std.BlankClip(format=vs.YUV410P8)
def ocring() -> None:
clip = SOURCE
ocr = OCR(get_y(clip), (1900, 125, 70), coord_al... | import vapoursynth as vs
from vardefunc.ocr import OCR
from vsutil import get_y
core = vs.core
# Import your clip
SOURCE = core.std.BlankClip(format=vs.YUV410P8)
def ocring() -> None:
clip = SOURCE
ocr = OCR(get_y(clip), (1900, 125, 70), coord_alt=(1500, 125, 70))
ocr.preview_cropped.set_output(0)
... | en | 0.516469 | # Import your clip | 2.132953 | 2 |
dags/tableau/.ipynb_checkpoints/config-checkpoint.py | divinorum-webb/docker-airflow | 1 | 6632207 | <reponame>divinorum-webb/docker-airflow<gh_stars>1-10
"""
Reference Notes
tableau_server_config details configuration for TableauServer class
'password' -> Note that this is NOT your AD password.
If you use your AD password, authentication will fail.
You will need to obtain your actual Tableau Server password for thi... | """
Reference Notes
tableau_server_config details configuration for TableauServer class
'password' -> Note that this is NOT your AD password.
If you use your AD password, authentication will fail.
You will need to obtain your actual Tableau Server password for this.
For example, your AD password could be '<PASSWORD>'... | en | 0.68281 | Reference Notes tableau_server_config details configuration for TableauServer class 'password' -> Note that this is NOT your AD password. If you use your AD password, authentication will fail. You will need to obtain your actual Tableau Server password for this. For example, your AD password could be '<PASSWORD>', bu... | 1.482136 | 1 |
spacenav_remote/src/spacenav_remote/server.py | carlosvquezada/lg_ros_nodes | 0 | 6632208 | #!/usr/bin/env python
import SocketServer
import thread
import socket
def print_handler(data):
print data
class MyTCPHandler(SocketServer.StreamRequestHandler):
def __init__(self, callback, *args, **keys):
self.callback = callback
SocketServer.StreamRequestHandler.__init__(self, *args, **k... | #!/usr/bin/env python
import SocketServer
import thread
import socket
def print_handler(data):
print data
class MyTCPHandler(SocketServer.StreamRequestHandler):
def __init__(self, callback, *args, **keys):
self.callback = callback
SocketServer.StreamRequestHandler.__init__(self, *args, **k... | en | 0.639124 | #!/usr/bin/env python # Create the server, binding to localhost on port 6564 Activate the server in separate thread | 2.911752 | 3 |
examples/splunk_to_argus.py | salesforce/python-argusclient | 16 | 6632209 | <gh_stars>10-100
#
# Copyright (c) 2016, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import requests, sys, json, os, time, calendar, csv, getpass, logging
from o... | #
# Copyright (c) 2016, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import requests, sys, json, os, time, calendar, csv, getpass, logging
from optparse import Op... | en | 0.834089 | # # Copyright (c) 2016, salesforce.com, inc. # All rights reserved. # Licensed under the BSD 3-Clause license. # For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause # # tsstr is expected to be in the default Splunk format: "2015-11-01T00:00:00.000+00:00" search ... | 2.03605 | 2 |
heat/engine/resources/openstack/mistral/workflow.py | maestro-hybrid-cloud/heat | 0 | 6632210 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | en | 0.756955 | # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ... | 1.63323 | 2 |
keyvaultlib/key_vault.py | Tom-Ganor/keyvaultlib | 0 | 6632211 | import logging
from logging import Logger
# noinspection PyPackageRequirements
from azure.keyvault import KeyVaultClient
from msrestazure.azure_active_directory import MSIAuthentication as MSICredentials, ServicePrincipalCredentials
class KeyVaultOAuthClient(KeyVaultClient):
"""
KeyVaultOAuthClient is a KeyV... | import logging
from logging import Logger
# noinspection PyPackageRequirements
from azure.keyvault import KeyVaultClient
from msrestazure.azure_active_directory import MSIAuthentication as MSICredentials, ServicePrincipalCredentials
class KeyVaultOAuthClient(KeyVaultClient):
"""
KeyVaultOAuthClient is a KeyV... | en | 0.704915 | # noinspection PyPackageRequirements KeyVaultOAuthClient is a KeyVault client wrapper that supports both MSI and ADAL authentication mechanisms. It's helpful for scenarios where one is transitioning from ADAL authentication to MSI, and exists to save the small code duplication of using either MSIAuthentica... | 2.373065 | 2 |
blog/models.py | asemarian/weCode | 1 | 6632212 | <reponame>asemarian/weCode<filename>blog/models.py
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from datetime import datetime, date
from ckeditor.fields import RichTextField
from django.db.models.signals import pre_save
from hitcount.models import HitCountMixi... | from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from datetime import datetime, date
from ckeditor.fields import RichTextField
from django.db.models.signals import pre_save
from hitcount.models import HitCountMixin, HitCount
from django.contrib.contenttypes.fields... | en | 0.23675 | # from django.utils.text import slugify | 1.991292 | 2 |
examples/__init__.py | HANhuiyu/SpikingStereoMatching | 1 | 6632213 | from examples.nst_letters import run_experiment_nst
from examples.two_fans import run_experiment_fans
from examples.pendulum import run_experiment_pendulum
| from examples.nst_letters import run_experiment_nst
from examples.two_fans import run_experiment_fans
from examples.pendulum import run_experiment_pendulum
| none | 1 | 1.040603 | 1 | |
python_code/vnev/Lib/site-packages/jdcloud_sdk/services/cdn/models/WafBlackRuleModel.py | Ureimu/weather-robot | 14 | 6632214 | <gh_stars>10-100
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 applicab... | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | en | 0.623542 | # coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 t... | 1.699171 | 2 |
src/pudl/workspace/setup.py | kevinsung/pudl | 285 | 6632215 | <filename>src/pudl/workspace/setup.py
"""Tools for setting up and managing PUDL workspaces."""
import importlib
import logging
import pathlib
import shutil
import yaml
from pudl import constants as pc
logger = logging.getLogger(__name__)
def set_defaults(pudl_in, pudl_out, clobber=False):
"""
Set default u... | <filename>src/pudl/workspace/setup.py
"""Tools for setting up and managing PUDL workspaces."""
import importlib
import logging
import pathlib
import shutil
import yaml
from pudl import constants as pc
logger = logging.getLogger(__name__)
def set_defaults(pudl_in, pudl_out, clobber=False):
"""
Set default u... | en | 0.83142 | Tools for setting up and managing PUDL workspaces. Set default user input and output locations in ``$HOME/.pudl.yml``. Create a user settings file for future reference, that defines the default PUDL input and output directories. If this file already exists, behavior depends on the clobber parameter, which ... | 2.645661 | 3 |
ts/torch_handler/unit_tests/test_image_classifier.py | akarazniewicz/serve | 1 | 6632216 | # pylint: disable=W0621
# Using the same name as global function is part of pytest
"""
Basic unit test for ImageClassifier class.
Ensures it can load and execute an example model
"""
import sys
import pytest
from ts.torch_handler.image_classifier import ImageClassifier
from .test_utils.mock_context import MockContext
... | # pylint: disable=W0621
# Using the same name as global function is part of pytest
"""
Basic unit test for ImageClassifier class.
Ensures it can load and execute an example model
"""
import sys
import pytest
from ts.torch_handler.image_classifier import ImageClassifier
from .test_utils.mock_context import MockContext
... | en | 0.729742 | # pylint: disable=W0621 # Using the same name as global function is part of pytest Basic unit test for ImageClassifier class. Ensures it can load and execute an example model | 2.631016 | 3 |
venv/Lib/site-packages/pandas/tests/series/indexing/test_delitem.py | OliviaNabbosa89/Disaster_Responses | 0 | 6632217 | import pytest
from pandas import Index, Series
import pandas._testing as tm
class TestSeriesDelItem:
def test_delitem(self):
# GH#5542
# should delete the item inplace
s = Series(range(5))
del s[0]
expected = Series(range(1, 5), index=range(1, 5))
tm... | import pytest
from pandas import Index, Series
import pandas._testing as tm
class TestSeriesDelItem:
def test_delitem(self):
# GH#5542
# should delete the item inplace
s = Series(range(5))
del s[0]
expected = Series(range(1, 5), index=range(1, 5))
tm... | en | 0.644094 | # GH#5542 # should delete the item inplace # only 1 left, del, add, del # Index(dtype=object) # empty | 2.68467 | 3 |
azext_iot/sdk/iothub/service/models/registry_statistics_py3.py | YingXue/azure-iot-cli-extension | 0 | 6632218 | <gh_stars>0
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | en | 0.564893 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 1.842679 | 2 |
Apps/rsp/eqcheck.py | zhanghongce/ila-mcm-fmcad18 | 0 | 6632219 | from traceStep import *
import axiom
# ---------------------------
# Configurations
# ---------------------------
FORCE_ALL_INST_DECODE_TRUE = True
DEBUG = False
# ---------------------------
# Prerequisites
# ---------------------------
def LAnd(l):
if len(l) == 0:
return z3.BoolVal(True)
elif... | from traceStep import *
import axiom
# ---------------------------
# Configurations
# ---------------------------
FORCE_ALL_INST_DECODE_TRUE = True
DEBUG = False
# ---------------------------
# Prerequisites
# ---------------------------
def LAnd(l):
if len(l) == 0:
return z3.BoolVal(True)
elif... | en | 0.667276 | # --------------------------- # Configurations # --------------------------- # --------------------------- # Prerequisites # --------------------------- # --------------------------- # clInstruction = openclrsp.CL_load_DV_N # gpuInstruction = [ gpuModel.ev_FETCH_L1 , gpuModel.inst_LD , gpuModel.inst_INV_L1_WG ] # fetch... | 1.903766 | 2 |
src/python/pants/backend/python/target_types_rules.py | rcuza/pants | 0 | 6632220 | <reponame>rcuza/pants
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Rules for the core Python target types.
This is a separate module to avoid circular dependencies. Note that all types used by call sites are
defined in `target_ty... | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Rules for the core Python target types.
This is a separate module to avoid circular dependencies. Note that all types used by call sites are
defined in `target_types.py`.
"""
import da... | en | 0.707392 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). Rules for the core Python target types. This is a separate module to avoid circular dependencies. Note that all types used by call sites are defined in `target_types.py`. # ---------------... | 1.916352 | 2 |
reskit/test/test_CosmoSource.py | r-beer/RESKit | 0 | 6632221 | def test___init__():
# (s, source, bounds=None, indexPad=0, **kwargs):
print( "__init__ not tested...")
def test_loc2Index():
# (s, loc, outsideOkay=False, asInt=True):
print( "loc2Index not tested...")
def test_loadRadiation():
# (s):
print( "loadRadiation not tested...")
def test_loadWindSp... | def test___init__():
# (s, source, bounds=None, indexPad=0, **kwargs):
print( "__init__ not tested...")
def test_loc2Index():
# (s, loc, outsideOkay=False, asInt=True):
print( "loc2Index not tested...")
def test_loadRadiation():
# (s):
print( "loadRadiation not tested...")
def test_loadWindSp... | en | 0.74998 | # (s, source, bounds=None, indexPad=0, **kwargs): # (s, loc, outsideOkay=False, asInt=True): # (s): # (s): # (s, height=100): # (s, processor=lambda x: x-273.15): # (s): # (s): # (s, locations, heights, spatialInterpolation='near', forceDataFrame=False, outsideOkay=False, _indicies=None): | 2.254461 | 2 |
hdf2mic/writer_dri.py | ralph0101/hdf2mic-converter | 1 | 6632222 | # -*- coding: utf-8 -*-
r"""
This module contains the MICRESS input driving file writer for the script hdf2mic.py.
"""
import os
import re
from hdf2mic.data import *
from hdf2mic.writer import *
from hdf2mic.arg_mapping import ArgMap_settingsOutputDri
class DriWriter(Writer):
"""
Reads a tagged MICRESS driv... | # -*- coding: utf-8 -*-
r"""
This module contains the MICRESS input driving file writer for the script hdf2mic.py.
"""
import os
import re
from hdf2mic.data import *
from hdf2mic.writer import *
from hdf2mic.arg_mapping import ArgMap_settingsOutputDri
class DriWriter(Writer):
"""
Reads a tagged MICRESS driv... | en | 0.591926 | # -*- coding: utf-8 -*- This module contains the MICRESS input driving file writer for the script hdf2mic.py. Reads a tagged MICRESS driving template file, replaces tags and writes result. Tags in the template are of the form <mytagname>. Notes ----- Use with a context manager (see example). Examp... | 2.842708 | 3 |
camera-test.py | AluminatiFRC/Vision2016 | 4 | 6632223 | <gh_stars>1-10
import cv2
cap = cv2.VideoCapture(0)
print "OpenCV version: " + cv2.__version__
while(True):
ret, frame = cap.read()
if ret:
cv2.imshow('source', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
| import cv2
cap = cv2.VideoCapture(0)
print "OpenCV version: " + cv2.__version__
while(True):
ret, frame = cap.read()
if ret:
cv2.imshow('source', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows() | none | 1 | 2.889409 | 3 | |
hwt/synthesizer/rtlLevel/signalUtils/ops.py | mgielda/hwt | 0 | 6632224 | <reponame>mgielda/hwt
from hwt.doc_markers import internal
from hwt.hdl.assignment import Assignment
from hwt.hdl.operatorDefs import AllOps
from hwt.hdl.types.defs import BOOL
from hwt.hdl.types.sliceUtils import slice_to_SLICE
from hwt.hdl.types.typeCast import toHVal
from hwt.synthesizer.exceptions import TypeConver... | from hwt.doc_markers import internal
from hwt.hdl.assignment import Assignment
from hwt.hdl.operatorDefs import AllOps
from hwt.hdl.types.defs import BOOL
from hwt.hdl.types.sliceUtils import slice_to_SLICE
from hwt.hdl.types.typeCast import toHVal
from hwt.synthesizer.exceptions import TypeConversionErr
from hwt.synth... | en | 0.819578 | Value class for type of signal Definitions of operators and other operator functions for RtlSignal :ivar _usedOps: cache for expressions with this signal Try lookup operator with this parameters in _usedOps if not found create new one and soter it in _usedOps :param operator: instance of OpDefinit... | 1.802101 | 2 |
neo_utils/core.py | Pierre-Thibault/neo-utils | 0 | 6632225 | <filename>neo_utils/core.py
# -*- coding: utf-8 -*-
'''
Fundamental functions and class helpers to support everyday programming.
@author: <NAME> (<EMAIL>re.thibault1 -at- gmail.com)
@license: MIT
@since: 2010-11-10
'''
__docformat__ = "epytext en"
import functools
class Prototype:
"""
An empty class to crea... | <filename>neo_utils/core.py
# -*- coding: utf-8 -*-
'''
Fundamental functions and class helpers to support everyday programming.
@author: <NAME> (<EMAIL>re.thibault1 -at- gmail.com)
@license: MIT
@since: 2010-11-10
'''
__docformat__ = "epytext en"
import functools
class Prototype:
"""
An empty class to crea... | en | 0.685306 | # -*- coding: utf-8 -*- Fundamental functions and class helpers to support everyday programming. @author: <NAME> (<EMAIL>re.thibault1 -at- gmail.com) @license: MIT @since: 2010-11-10 An empty class to create objects as prototypes. Client are free to add properties to instances of this type. I created this clas... | 3.338797 | 3 |
core/models.py | ResearchKernel/search | 2 | 6632226 | <reponame>ResearchKernel/search
from uuid import uuid4
from django.db import models
class BaseModelMixin(models.Model):
created = models.DateTimeField(auto_now_add=True, null=True)
modified = models.DateTimeField(auto_now=True)
id = models.UUIDField(
primary_key=True, default=uuid4, editable=Fals... | from uuid import uuid4
from django.db import models
class BaseModelMixin(models.Model):
created = models.DateTimeField(auto_now_add=True, null=True)
modified = models.DateTimeField(auto_now=True)
id = models.UUIDField(
primary_key=True, default=uuid4, editable=False,
max_length=36, unique... | none | 1 | 2.237287 | 2 | |
predict.py | TerenceChen95/Retina-Unet-Pytorch | 5 | 6632227 | import torch
from PIL import Image
from torch.autograd import Variable
import numpy as np
from matplotlib import pyplot as plt
from models.net2 import UNET
from torchvision import transforms as transforms
import torch.nn.functional as F
from config import config
from posprocess import rgb2gray, pad_border, recover_over... | import torch
from PIL import Image
from torch.autograd import Variable
import numpy as np
from matplotlib import pyplot as plt
from models.net2 import UNET
from torchvision import transforms as transforms
import torch.nn.functional as F
from config import config
from posprocess import rgb2gray, pad_border, recover_over... | en | 0.92714 | #normalize input #batch_size = 32 #patches too large to be put into model all at once | 2.189336 | 2 |
demo/examples/sum.summa/usage.py | YourNorth/rezak-summarizator | 3 | 6632228 | """
NOTE: Здесь описываем базовое использование модуля (без прочих настроек)
"""
from summa.summarizer import summarize
example = """
Automatic summarization is the process of reducing a text document with a \
computer program in order to create a summary that retains the most important points \
of the original docum... | """
NOTE: Здесь описываем базовое использование модуля (без прочих настроек)
"""
from summa.summarizer import summarize
example = """
Automatic summarization is the process of reducing a text document with a \
computer program in order to create a summary that retains the most important points \
of the original docum... | en | 0.844707 | NOTE: Здесь описываем базовое использование модуля (без прочих настроек) Automatic summarization is the process of reducing a text document with a \ computer program in order to create a summary that retains the most important points \ of the original document. As the problem of information overload has grown, and as \... | 3.959 | 4 |
01-presentation-example/01_simple_open.py | ryansmccoy/201911-spreadsheets-to-dataframes | 28 | 6632229 |
filename = r'data\WMT_US.csv'
f = open(filename, 'r')
print(f)
data = f.read()
print(data)
f.close()
f = open(filename, 'r') # open file
for line in f:
print(line)
f.close() # close file
|
filename = r'data\WMT_US.csv'
f = open(filename, 'r')
print(f)
data = f.read()
print(data)
f.close()
f = open(filename, 'r') # open file
for line in f:
print(line)
f.close() # close file
| en | 0.848327 | # open file # close file | 3.352008 | 3 |
source/CRRMonitor/CRRMonitor.py | AugusYin/aws-crr-monitor-master-GCR | 41 | 6632230 | #!/usr/bin/python
# -*- coding: utf-8 -*-
######################################################################################################################
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | #!/usr/bin/python
# -*- coding: utf-8 -*-
######################################################################################################################
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | en | 0.729153 | #!/usr/bin/python # -*- coding: utf-8 -*- ###################################################################################################################### # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ... | 2.085945 | 2 |
app/controllers/authControllers.py | nicolunardi/travela-server | 0 | 6632231 | <reponame>nicolunardi/travela-server
from fastapi import HTTPException, status, Depends
from email_validator import EmailNotValidError
from sqlalchemy.orm import Session
from app.schemas.tokens import Token
from app.models.users import User as UserModel
from app.schemas.users import UserCreate, UserLogin
from app.depen... | from fastapi import HTTPException, status, Depends
from email_validator import EmailNotValidError
from sqlalchemy.orm import Session
from app.schemas.tokens import Token
from app.models.users import User as UserModel
from app.schemas.users import UserCreate, UserLogin
from app.dependencies.authentication import (
g... | en | 0.883382 | # check the email address isn't already in use # ensure the email address is valid # create the user # add the user to the db # if the user was created without problems, generate the jwt token # check if the user exists in the db # check if the passwords match | 2.785975 | 3 |
tests/parsers/bsm.py | ir4n6/plaso | 0 | 6632232 | <filename>tests/parsers/bsm.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for Basic Security Module (BSM) file parser."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import bsm as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers import ... | <filename>tests/parsers/bsm.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for Basic Security Module (BSM) file parser."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import bsm as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers import ... | en | 0.523967 | #!/usr/bin/python # -*- coding: utf-8 -*- Tests for Basic Security Module (BSM) file parser. # pylint: disable=unused-import Tests for Basic Security Module (BSM) file parser. Tests the Parse function on a MacOS BSM file. Tests for Basic Security Module (BSM) file parser. Tests the Parse function on a "generic" BSM fil... | 2.497015 | 2 |
strategy/deribit_cross_remote_future.py | Hudie/crypto_algo_trading | 20 | 6632233 | # -*- coding: utf-8 -*-
import zmq.asyncio
import asyncio
import json
from crypto_trading.service.base import ServiceState, ServiceBase, start_service
# from crypto_trading.config import *
DERIBIT_ACCOUNT_ID = 'maxlu'
SYMBOL = 'BTC'
MINIMUM_TICK_SIZE = 0.5
NEAR_FUTURE = 'BTC-25SEP20'
FAR_FUTURE = 'BTC-25DEC20'
LONG... | # -*- coding: utf-8 -*-
import zmq.asyncio
import asyncio
import json
from crypto_trading.service.base import ServiceState, ServiceBase, start_service
# from crypto_trading.config import *
DERIBIT_ACCOUNT_ID = 'maxlu'
SYMBOL = 'BTC'
MINIMUM_TICK_SIZE = 0.5
NEAR_FUTURE = 'BTC-25SEP20'
FAR_FUTURE = 'BTC-25DEC20'
LONG... | en | 0.816902 | # -*- coding: utf-8 -*- # from crypto_trading.config import * # margin: [equity, initial_margin, maintenance_margin] # subscribe market data # request client for transaction # subscribe transaction data # async queue to sequentially combine market data and tx data # find gap between perpetual and current season future,... | 2.196787 | 2 |
tool/comparispawn.bzl | grencez/lace | 1 | 6632234 | <reponame>grencez/lace
load("@fildesh//tool:spawn.bzl", "spawn_test")
def fildesh_expect_test(name, srcs, expect,
data=[], args=[], size="small",
**kwargs):
spawn_test(
name = name,
data = [
expect,
"@fildesh//tool:comparispawn",
... | load("@fildesh//tool:spawn.bzl", "spawn_test")
def fildesh_expect_test(name, srcs, expect,
data=[], args=[], size="small",
**kwargs):
spawn_test(
name = name,
data = [
expect,
"@fildesh//tool:comparispawn",
"@fildesh//:fildesh"... | none | 1 | 1.863409 | 2 | |
tests/utils/thread.py | gururajo/Self-Driving-Car | 0 | 6632235 | import threading
import time
numli=[1,2,3,4,5]
def add():
global num,s1,s2
for numbur in numli:
print(threading.currentThread(),"waiting for s1")
s1.acquire()
num=numbur
print(threading.currentThread(),"got s1")
#num= int(input())
num+=3
... | import threading
import time
numli=[1,2,3,4,5]
def add():
global num,s1,s2
for numbur in numli:
print(threading.currentThread(),"waiting for s1")
s1.acquire()
num=numbur
print(threading.currentThread(),"got s1")
#num= int(input())
num+=3
... | en | 0.265228 | #num= int(input()) # time.sleep(10) # bt.join() # time.sleep(10) # bt.join() # time.sleep(10) # threading.excepthook(args=[]) | 3.997319 | 4 |
199_NSFW/demo/demo_nsfw_onnx.py | IgiArdiyanto/PINTO_model_zoo | 2 | 6632236 | <filename>199_NSFW/demo/demo_nsfw_onnx.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import argparse
import cv2 as cv
import numpy as np
import onnxruntime
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--image",
type=str,
default='image/sampl... | <filename>199_NSFW/demo/demo_nsfw_onnx.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import argparse
import cv2 as cv
import numpy as np
import onnxruntime
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--image",
type=str,
default='image/sampl... | en | 0.671448 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Pre process:Resize, RGB->BGR, Transpose, float32 cast # Inference # Post process # Load model # read image # Inference execution | 2.456852 | 2 |
apps/zop/zop.py | herimonster/zoid | 0 | 6632237 | <reponame>herimonster/zoid<filename>apps/zop/zop.py<gh_stars>0
import zapp
import zframe
import zborderframe
import zlabel
import zkeylabel
import zlineedit
import ztextedit
import ztable
import zutils
import os
import re
import pwd
class zop(zapp.zapp):
PROC_DIR = "/proc"
def get_user(self, id):
try:
retur... | import zapp
import zframe
import zborderframe
import zlabel
import zkeylabel
import zlineedit
import ztextedit
import ztable
import zutils
import os
import re
import pwd
class zop(zapp.zapp):
PROC_DIR = "/proc"
def get_user(self, id):
try:
return str(pwd.getpwuid( id ).pw_name)
except:
return str(id)
... | en | 0.200178 | #print(infile) #d = [item.split(":") for item in data.split("\n")] #tab.add_row([str(i), "Test", "root", "1024", "43", "1", "/bin/Test"]) #mem = str(int(float(mem.split(" ")[0]) / 1000.0)) #tab.rows.append([str(i), procs[i]["Name"], self.get_user(int(procs[i]["Pid"])), procs[i]["VmSize"] if "VmSize" in procs[i] else ""... | 2.193503 | 2 |
tests/gridworld_test.py | Duckie-town-isu/tulip-control | 91 | 6632238 | <filename>tests/gridworld_test.py
"""Tests for the tulip.gridworld."""
from __future__ import division
from __future__ import print_function
try:
from dd import cudd as dd_cudd
except ImportError:
dd_cudd = None
import numpy as np
import pytest
import tulip.gridworld as gw
import unittest
from tulip.synth imp... | <filename>tests/gridworld_test.py
"""Tests for the tulip.gridworld."""
from __future__ import division
from __future__ import print_function
try:
from dd import cudd as dd_cudd
except ImportError:
dd_cudd = None
import numpy as np
import pytest
import tulip.gridworld as gw
import unittest
from tulip.synth imp... | en | 0.78507 | Tests for the tulip.gridworld. # A very small example, realizable by itself. 6 10 * G* *** *** * I * * * ****** * * 4 4 **G ** I* * 2 2 * # Module-level fixture setup # Make pseudorandom number sequence repeatable # Reachability is assumed to be bidirectional # No offset # Offset # No offset # Equa... | 2.585206 | 3 |
jackselect/devmonitor.py | SpotlightKid/jack-select | 12 | 6632239 | # -*- coding: utf-8 -*-
"""Set up an udev monitor to be notified about changes in attached sound devices."""
import logging
from pyudev import Context, Monitor
from .pyudev_gobject import MonitorObserver
log = logging.getLogger(__name__)
class AlsaDevMonitor:
def __init__(self, callback):
# set up ude... | # -*- coding: utf-8 -*-
"""Set up an udev monitor to be notified about changes in attached sound devices."""
import logging
from pyudev import Context, Monitor
from .pyudev_gobject import MonitorObserver
log = logging.getLogger(__name__)
class AlsaDevMonitor:
def __init__(self, callback):
# set up ude... | en | 0.806524 | # -*- coding: utf-8 -*- Set up an udev monitor to be notified about changes in attached sound devices. # set up udev device monitor | 2.611645 | 3 |
objectModel/Python/cdm/objectmodel/cdm_folder_collection.py | Venkata1920/CDM | 1 | 6632240 | <reponame>Venkata1920/CDM
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Union, List
from cdm.enums import CdmObjectType
from .cdm_collection import CdmCollection
class CdmFolderCollectio... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Union, List
from cdm.enums import CdmObjectType
from .cdm_collection import CdmCollection
class CdmFolderCollection(CdmCollection):
def ... | en | 0.904216 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # TODO: At this point we should also propagate the root adapter into the child folder # and all its sub-folders and contained documents. For now, don't add things to... | 2.031296 | 2 |
python/day10.py | JohanWranker/advent-of-code-2020 | 0 | 6632241 | <filename>python/day10.py<gh_stars>0
import os
import re
from datetime import datetime
import time
print("day10")
path = "input"
if not os.path.exists(path):
print(" File not exist ", os.path.abspath(path))
exit(1)
rawtext = open(path).readlines()
# Get all joltage all inital 0 and sort it
data = sorted([0] +... | <filename>python/day10.py<gh_stars>0
import os
import re
from datetime import datetime
import time
print("day10")
path = "input"
if not os.path.exists(path):
print(" File not exist ", os.path.abspath(path))
exit(1)
rawtext = open(path).readlines()
# Get all joltage all inital 0 and sort it
data = sorted([0] +... | en | 0.918999 | # Get all joltage all inital 0 and sort it # List with "next" joltage - include output which is last +3 # Make a difflist #dict over the paths to the device, add the last jolt which has 1 exit path # handle the jolts starting at the last-but-one # Test each jolt with offset 1-3 # New path found, add based on the number... | 3.072922 | 3 |
Test/test_DirtyWordOfFilter.py | Rainstyd/rainsty | 1 | 6632242 | <filename>Test/test_DirtyWordOfFilter.py
# test_DirtyWordOfFilter.py
from Algorithm.DirtyWordOfFilter import DFAFilter
import time
def main():
time1 = time.time()
gfw = DFAFilter()
text = "你真是个大傻逼,大傻子,傻大个,大坏蛋,坏人。乱交, 乱小"
result = gfw.filter(text)
print(text)
print(result)
time2 = time.tim... | <filename>Test/test_DirtyWordOfFilter.py
# test_DirtyWordOfFilter.py
from Algorithm.DirtyWordOfFilter import DFAFilter
import time
def main():
time1 = time.time()
gfw = DFAFilter()
text = "你真是个大傻逼,大傻子,傻大个,大坏蛋,坏人。乱交, 乱小"
result = gfw.filter(text)
print(text)
print(result)
time2 = time.tim... | en | 0.170308 | # test_DirtyWordOfFilter.py | 2.89309 | 3 |
models/shum/ashum.py | INTENS-FI/intens | 0 | 6632243 | """Attempt to use asyncio.
Failed because asyncio subprocess support requires setup in the main
thread, which we do not control in the Dask worker.
"""
from concurrent.futures import CancelledError
import asyncio, os, traceback as tb
import dask
async def run_it(spec):
#TODO
script = os.path.join(os.path.di... | """Attempt to use asyncio.
Failed because asyncio subprocess support requires setup in the main
thread, which we do not control in the Dask worker.
"""
from concurrent.futures import CancelledError
import asyncio, os, traceback as tb
import dask
async def run_it(spec):
#TODO
script = os.path.join(os.path.di... | en | 0.871562 | Attempt to use asyncio. Failed because asyncio subprocess support requires setup in the main thread, which we do not control in the Dask worker. #TODO | 2.497871 | 2 |
gdc_rnaseq_tools/merge_junctions.py | NCI-GDC/gdc-rnaseq-tool | 0 | 6632244 | """A gdc-rnaseq-tools subcommand to format and merge STAR junction counts
files from the same sample.
@author: <NAME> <<EMAIL>>
"""
from operator import itemgetter
from gdc_rnaseq_tools.utils import get_logger, get_open_function
COLUMN_NAMES = [
"chromosome",
"intron_start",
"intron_end",
"strand",
... | """A gdc-rnaseq-tools subcommand to format and merge STAR junction counts
files from the same sample.
@author: <NAME> <<EMAIL>>
"""
from operator import itemgetter
from gdc_rnaseq_tools.utils import get_logger, get_open_function
COLUMN_NAMES = [
"chromosome",
"intron_start",
"intron_end",
"strand",
... | en | 0.83875 | A gdc-rnaseq-tools subcommand to format and merge STAR junction counts files from the same sample. @author: <NAME> <<EMAIL>> Represents a row in the SJ file The first six columns are the identifiers and are used to match between input files. Initialize record from a line. Used to merge overlapping records by a... | 2.902023 | 3 |
django_messages/forms.py | mirumee/django-messages | 16 | 6632245 | <reponame>mirumee/django-messages<filename>django_messages/forms.py
import datetime
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_noop
from django.contrib.auth.models import User
import uuid
if "notificati... | import datetime
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_noop
from django.contrib.auth.models import User
import uuid
if "notification" in settings.INSTALLED_APPS:
from notification import models ... | en | 0.729635 | base message form # clone messages in recipients inboxes # skip duplicates A simple default form for private messages. reply to form # find parent in recipient messages # message may be deleted | 2.09474 | 2 |
Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py | Alpine-DAV/WarpX | 0 | 6632246 | <gh_stars>0
#!/usr/bin/env python3
from pywarpx import picmi
# Physical constants
c = picmi.constants.c
q_e = picmi.constants.q_e
# Number of time steps
max_steps = 100
# Number of cells
nx = 32
ny = 32
nz = 256
# Physical domain
xmin = -30e-06
xmax = 30e-06
ymin = -30e-06
ymax = 30e-06
zmin = -56e-06
zmax = 12... | #!/usr/bin/env python3
from pywarpx import picmi
# Physical constants
c = picmi.constants.c
q_e = picmi.constants.q_e
# Number of time steps
max_steps = 100
# Number of cells
nx = 32
ny = 32
nz = 256
# Physical domain
xmin = -30e-06
xmax = 30e-06
ymin = -30e-06
ymax = 30e-06
zmin = -56e-06
zmax = 12e-06
# Doma... | en | 0.637696 | #!/usr/bin/env python3 # Physical constants # Number of time steps # Number of cells # Physical domain # Domain decomposition # Create grid # Particles: plasma electrons # Particles: beam electrons # Laser # Electromagnetic solver # Diagnostics # Set up simulation # Add plasma electrons # Add beam electrons # Add laser... | 1.855406 | 2 |
Examples/input_text_example.py | mmorandi/DearPyGui | 0 | 6632247 | <filename>Examples/input_text_example.py
from dearpygui.core import *
from dearpygui.simple import *
set_main_window_size(500, 500)
# callback
def retrieve_callback(sender, callback):
show_logger()
log_info(get_value("Regular##inputtext"))
log_info(get_value("With hint##inputtext"))
log_info(get_valu... | <filename>Examples/input_text_example.py
from dearpygui.core import *
from dearpygui.simple import *
set_main_window_size(500, 500)
# callback
def retrieve_callback(sender, callback):
show_logger()
log_info(get_value("Regular##inputtext"))
log_info(get_value("With hint##inputtext"))
log_info(get_valu... | ja | 0.37475 | # callback ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext")) ##inputtext") ##inputtext", hint="A hint") ##inputtext", no_spaces=True) ##inputtext", uppercase=True) ##inputtext", decimal=True) ##inputtext", hexadecimal=True) ##inputtext... | 3.228554 | 3 |
commands/setcannon.py | 1757WestwoodRobotics/mentorbot | 2 | 6632248 | <reponame>1757WestwoodRobotics/mentorbot<gh_stars>1-10
from enum import Enum, auto
from subsystems.cannonsubsystem import CannonSubsystem
from commands2 import CommandBase
class SetCannon(CommandBase):
class Mode(Enum):
Off = auto()
Fill = auto()
Launch = auto()
def __init__(self, can... | from enum import Enum, auto
from subsystems.cannonsubsystem import CannonSubsystem
from commands2 import CommandBase
class SetCannon(CommandBase):
class Mode(Enum):
Off = auto()
Fill = auto()
Launch = auto()
def __init__(self, cannon: CannonSubsystem, mode: Mode) -> None:
Comm... | none | 1 | 2.769027 | 3 | |
python-lib/org_manager_bot.py | abrazite/sc-org | 0 | 6632249 | import discord
from discord.ext import commands, tasks
import org_manager_api
import theimc
import secrets
import string
import os
os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(
'/etc/ssl/certs/',
'ca-certificates.crt')
# API Server
API_SERVER = 'https://api.org-manager.space/1.0.0'
api = org_manager_api.Or... | import discord
from discord.ext import commands, tasks
import org_manager_api
import theimc
import secrets
import string
import os
os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(
'/etc/ssl/certs/',
'ca-certificates.crt')
# API Server
API_SERVER = 'https://api.org-manager.space/1.0.0'
api = org_manager_api.Or... | en | 0.39764 | # API Server # Prefix for calling bot in discord # Runs on start to show bot is online # Clear messages in chat # todo(James): format date :) #{ctx.author.discriminator}') #{personnel["discriminator"]}' #{ctx.author.discriminator}') #{ctx.author.discriminator}') #{ctx.author.discriminator}') #{ctx.author.discriminator}... | 2.419804 | 2 |
vk/types/responses/docs.py | Inzilkin/vk.py | 24 | 6632250 | <reponame>Inzilkin/vk.py
from .others import SimpleResponse
from ..base import BaseModel
from ..attachments import Document
import typing
class Add(SimpleResponse):
pass
class Delete(SimpleResponse):
pass
class Edit(SimpleResponse):
pass
class GetResponse(BaseModel):
count: int = None
item... | from .others import SimpleResponse
from ..base import BaseModel
from ..attachments import Document
import typing
class Add(SimpleResponse):
pass
class Delete(SimpleResponse):
pass
class Edit(SimpleResponse):
pass
class GetResponse(BaseModel):
count: int = None
items: typing.List[Document] ... | none | 1 | 2.10805 | 2 |