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 |
|---|---|---|---|---|---|---|---|---|---|---|
Image classifier/train.py | anirudha-bs/Farm_assist | 0 | 10300 | from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from keras import regularizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.preprocessing.image import Ima... | from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from keras import regularizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.preprocessing.image import Ima... | en | 0.762645 | # defining classes # Adding dataset paths # hyperparameters # data generators # defining the model # training and validation graphs # for testing trained model with images differnent class | 2.535937 | 3 |
questions/q118_linked_list_loop_removal/code.py | aadhityasw/Competitive-Programs | 0 | 10301 | def removeLoop(head):
ptr = head
ptr2 = head
while True :
if ptr is None or ptr2 is None or ptr2.next is None :
return
ptr = ptr.next
ptr2 = ptr2.next.next
if ptr is ptr2 :
loopNode = ptr
break
ptr = loopNode.next
count = ... | def removeLoop(head):
ptr = head
ptr2 = head
while True :
if ptr is None or ptr2 is None or ptr2.next is None :
return
ptr = ptr.next
ptr2 = ptr2.next.next
if ptr is ptr2 :
loopNode = ptr
break
ptr = loopNode.next
count = ... | none | 1 | 3.824605 | 4 | |
fastrunner/httprunner3/report/html/gen_report.py | Chankee/AutoTestRunner | 1 | 10302 | <gh_stars>1-10
import io
import os
from datetime import datetime
from jinja2 import Template
from loguru import logger
from httprunner.exceptions import SummaryEmpty
def gen_html_report(summary, report_template=None, report_dir=None, report_file=None):
""" render html report with specified report name and templ... | import io
import os
from datetime import datetime
from jinja2 import Template
from loguru import logger
from httprunner.exceptions import SummaryEmpty
def gen_html_report(summary, report_template=None, report_dir=None, report_file=None):
""" render html report with specified report name and template
Args:
... | en | 0.515722 | render html report with specified report name and template Args: summary (dict): test result summary data report_template (str): specify html report template path, template should be in Jinja2 format. report_dir (str): specify html report save directory report_file (str): specify ht... | 2.766206 | 3 |
SD/lab1/client.py | matheuscr30/UFU | 0 | 10303 | #client.py
#!/usr/bin/python # This is client.py file
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12352 ... | #client.py
#!/usr/bin/python # This is client.py file
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12352 ... | en | 0.573668 | #client.py #!/usr/bin/python # This is client.py file # Import socket module # Create a socket object # Get local machine name # Reserve a port for your service. | 3.410321 | 3 |
tests/helpers.py | ws4/TopCTFd | 1 | 10304 | <reponame>ws4/TopCTFd
from CTFd import create_app
from CTFd.models import *
from sqlalchemy_utils import database_exists, create_database, drop_database
from sqlalchemy.engine.url import make_url
import datetime
import six
if six.PY2:
text_type = unicode
binary_type = str
else:
text_type = str
binary_t... | from CTFd import create_app
from CTFd.models import *
from sqlalchemy_utils import database_exists, create_database, drop_database
from sqlalchemy.engine.url import make_url
import datetime
import six
if six.PY2:
text_type = unicode
binary_type = str
else:
text_type = str
binary_type = bytes
def crea... | en | 0.799536 | # Populate session with nonce | 2.569187 | 3 |
homeassistant/components/kaiterra/const.py | MrDelik/core | 30,023 | 10305 | """Consts for Kaiterra integration."""
from datetime import timedelta
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
Platform,
)
DOMAIN = "kaite... | """Consts for Kaiterra integration."""
from datetime import timedelta
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
Platform,
)
DOMAIN = "kaite... | en | 0.595333 | Consts for Kaiterra integration. | 1.72613 | 2 |
support/views.py | bhagirath1312/ich_bau | 1 | 10306 | <filename>support/views.py
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from .models import SupportProject
# Create your views here.
def index( request ):
sp = SupportProject.objects.all()
if sp.count() == 1:
return HttpResponseRedirect( sp.first().p... | <filename>support/views.py
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from .models import SupportProject
# Create your views here.
def index( request ):
sp = SupportProject.objects.all()
if sp.count() == 1:
return HttpResponseRedirect( sp.first().p... | en | 0.968116 | # Create your views here. | 1.819845 | 2 |
timeline/models.py | KolibriSolutions/BepMarketplace | 1 | 10307 | <gh_stars>1-10
# Bep Marketplace ELE
# Copyright (c) 2016-2021 Kolibri Solutions
# License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE
#
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
class TimeSlot(mode... | # Bep Marketplace ELE
# Copyright (c) 2016-2021 Kolibri Solutions
# License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE
#
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
class TimeSlot(models.Model):
... | en | 0.894238 | # Bep Marketplace ELE # Copyright (c) 2016-2021 Kolibri Solutions # License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE # A timeslot is a year in which the current BEP runs. It consists of multiple timephases. A time phase is a phase the system is in. Each phase has it... | 2.632571 | 3 |
app/api/user_routes.py | nappernick/envelope | 2 | 10308 | from datetime import datetime
from werkzeug.security import generate_password_hash
from flask import Blueprint, jsonify, request
from sqlalchemy.orm import joinedload
from flask_login import login_required
from app.models import db, User, Type
from app.forms import UpdateUserForm
from .auth_routes import authenticate, ... | from datetime import datetime
from werkzeug.security import generate_password_hash
from flask import Blueprint, jsonify, request
from sqlalchemy.orm import joinedload
from flask_login import login_required
from app.models import db, User, Type
from app.forms import UpdateUserForm
from .auth_routes import authenticate, ... | none | 1 | 2.421405 | 2 | |
timeflux/nodes/ml.py | OpenMindInnovation/timeflux | 0 | 10309 | """Machine Learning"""
import importlib
import numpy as np
import pandas as pd
import json
from jsonschema import validate
from sklearn.pipeline import make_pipeline
from timeflux.core.node import Node
from timeflux.core.exceptions import ValidationError, WorkerInterrupt
from timeflux.helpers.background import Task
fr... | """Machine Learning"""
import importlib
import numpy as np
import pandas as pd
import json
from jsonschema import validate
from sklearn.pipeline import make_pipeline
from timeflux.core.node import Node
from timeflux.core.exceptions import ValidationError, WorkerInterrupt
from timeflux.helpers.background import Task
fr... | en | 0.707414 | Machine Learning # Statuses Fit, transform and predict. Training on continuous data is always unsupervised. Training on epoched data can either be supervised or unsupervised. If fit is `False`, input events are ignored, and initital training is not performed. Automatically set to False if mode is eith... | 2.137059 | 2 |
cms/migrations/0006_auto_20170122_1545.py | josemlp91/django-landingcms | 0 | 10310 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-22 15:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('content', '0002_auto_20170122_1509'),
('cms', '0005... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-22 15:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('content', '0002_auto_20170122_1509'),
('cms', '0005... | en | 0.712524 | # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-22 15:45 | 1.649861 | 2 |
1-lab-lambdaDynamoDB/source/cdk/app.py | donnieprakoso/workshop-buildingRESTAPIwithAWS | 23 | 10311 | <reponame>donnieprakoso/workshop-buildingRESTAPIwithAWS
#!/usr/bin/env python3
from aws_cdk import aws_iam as _iam
from aws_cdk import aws_lambda as _lambda
from aws_cdk import aws_dynamodb as _ddb
from aws_cdk import core
class CdkStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, stack_prefi... | #!/usr/bin/env python3
from aws_cdk import aws_iam as _iam
from aws_cdk import aws_lambda as _lambda
from aws_cdk import aws_dynamodb as _ddb
from aws_cdk import core
class CdkStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, stack_prefix:str, **kwargs) -> None:
super().__init__(scope... | en | 0.398728 | #!/usr/bin/env python3 # Model all required resources # THIS IS NOT RECOMMENDED FOR PRODUCTION USE ## IAM Roles # Add role for DynamoDB ## AWS Lambda Functions | 2.088131 | 2 |
module_6_lets_make_a_web_app/webapp/yield.py | JCarlos831/python_getting_started_-pluralsight- | 0 | 10312 | <reponame>JCarlos831/python_getting_started_-pluralsight-
students = []
def read_file():
try:
f = open("students.txt", "r")
for student in read_students(f):
students.append(student)
f.close()
except Exception:
print("Could not read file")
def read_students(f):
... | students = []
def read_file():
try:
f = open("students.txt", "r")
for student in read_students(f):
students.append(student)
f.close()
except Exception:
print("Could not read file")
def read_students(f):
for line in f:
yield line
read_file()
print(stu... | none | 1 | 3.776384 | 4 | |
paul_analysis/Python/labird/gamma.py | lzkelley/arepo-mbh-sims_analysis | 0 | 10313 | """Module for finding an effective equation of state for in the Lyman-alpha forest
from a snapshot. Ported to python from <NAME>'s IDL script."""
import h5py
import math
import numpy as np
def read_gamma(num,base):
"""Reads in an HDF5 snapshot from the NE gadget version, fits a power law to the
equation of st... | """Module for finding an effective equation of state for in the Lyman-alpha forest
from a snapshot. Ported to python from <NAME>'s IDL script."""
import h5py
import math
import numpy as np
def read_gamma(num,base):
"""Reads in an HDF5 snapshot from the NE gadget version, fits a power law to the
equation of st... | en | 0.555534 | Module for finding an effective equation of state for in the Lyman-alpha forest from a snapshot. Ported to python from <NAME>'s IDL script. Reads in an HDF5 snapshot from the NE gadget version, fits a power law to the equation of state for low density, low temperature gas. Inputs: num - snapshot number ... | 2.664358 | 3 |
evogym/envs/change_shape.py | federico-camerota/evogym | 78 | 10314 | <gh_stars>10-100
import gym
from gym import error, spaces
from gym import utils
from gym.utils import seeding
from evogym import *
from evogym.envs import BenchmarkBase
import random
from math import *
import numpy as np
import os
class ShapeBase(BenchmarkBase):
def __init__(self, world):
super().__... | import gym
from gym import error, spaces
from gym import utils
from gym.utils import seeding
from evogym import *
from evogym.envs import BenchmarkBase
import random
from math import *
import numpy as np
import os
class ShapeBase(BenchmarkBase):
def __init__(self, world):
super().__init__(world)
... | en | 0.660936 | # observation ### ---------------------------------------------------------------------- # This section of code is modified from the following author # from https://github.com/RodolfoFerro/ConvexHull # Author: <NAME> # Mail: <EMAIL> # Script: Compute the Convex Hull of a set of points using the Graham Scan # Function t... | 2.605301 | 3 |
pybind/slxos/v16r_1_00b/mpls_state/ldp/fec/ldp_fec_prefixes/__init__.py | shivharis/pybind | 0 | 10315 | <filename>pybind/slxos/v16r_1_00b/mpls_state/ldp/fec/ldp_fec_prefixes/__init__.py<gh_stars>0
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBoo... | <filename>pybind/slxos/v16r_1_00b/mpls_state/ldp/fec/ldp_fec_prefixes/__init__.py<gh_stars>0
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBoo... | en | 0.502833 | This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-mpls-operational - based on the path /mpls-state/ldp/fec/ldp-fec-prefixes. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: Getter method for tot_no_o... | 1.847884 | 2 |
pug/dj/miner/model_mixin.py | hobson/pug-dj | 0 | 10316 | from pug.nlp.db import representation
from django.db import models
class RepresentationMixin(models.Model):
"""Produce a meaningful string representation of a model with `str(model.objects.all[0])`."""
__unicode__ = representation
class Meta:
abstract = True
class DateMixin(models.Model):
""... | from pug.nlp.db import representation
from django.db import models
class RepresentationMixin(models.Model):
"""Produce a meaningful string representation of a model with `str(model.objects.all[0])`."""
__unicode__ = representation
class Meta:
abstract = True
class DateMixin(models.Model):
""... | en | 0.792242 | Produce a meaningful string representation of a model with `str(model.objects.all[0])`. Add updated and created fields that auto-populate to create a ORM-level transaction log for auditing (though not a full log, just 2 events). | 2.568376 | 3 |
custom_components/kodi_media_sensors/config_flow.py | JurajNyiri/kodi-media-sensors | 5 | 10317 | <reponame>JurajNyiri/kodi-media-sensors
import logging
from typing import Any, Dict, Optional
from homeassistant import config_entries
from homeassistant.components.kodi.const import DOMAIN as KODI_DOMAIN
from homeassistant.core import callback
import voluptuous as vol
from .const import (
OPTION_HIDE_WATCHED,
... | import logging
from typing import Any, Dict, Optional
from homeassistant import config_entries
from homeassistant.components.kodi.const import DOMAIN as KODI_DOMAIN
from homeassistant.core import callback
import voluptuous as vol
from .const import (
OPTION_HIDE_WATCHED,
OPTION_USE_AUTH_URL,
OPTION_SEARCH... | en | 0.752426 | Kodi Media Sensors config flow. Handle a flow initialized via the user interface. # Find all configured kodi instances to allow the user to select one. Get the options flow for this handler. Handles options flow for the component. Manage the options. | 2.100883 | 2 |
MySite/MainApp/views.py | tananyan/siteee | 1 | 10318 | from django.shortcuts import render
from django.views.generic.edit import FormView
from django.views.generic.edit import View
from . import forms
# Опять же, спасибо django за готовую форму аутентификации.
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import logout
from django... | from django.shortcuts import render
from django.views.generic.edit import FormView
from django.views.generic.edit import View
from . import forms
# Опять же, спасибо django за готовую форму аутентификации.
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import logout
from django... | ru | 0.99303 | # Опять же, спасибо django за готовую форму аутентификации. # Аналогично регистрации, только используем шаблон аутентификации. # В случае успеха перенаправим на главную. # Получаем объект пользователя на основе введённых в форму данных. # Выполняем аутентификацию пользователя. # Аналогично регистрации, только используе... | 2.143732 | 2 |
imagetagger/imagetagger/settings_base.py | jbargu/imagetagger | 1 | 10319 | """
Django settings for imagetagger project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | """
Django settings for imagetagger project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | en | 0.637708 | Django settings for imagetagger project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ # Build paths ... | 1.82748 | 2 |
apps/project/views/issue.py | rainydaygit/testtcloudserver | 349 | 10320 | <reponame>rainydaygit/testtcloudserver
from flask import request
from apps.auth.auth_require import required
from apps.project.business.issue import IssueBusiness, IssueRecordBusiness, IssueDashBoardBusiness
from apps.project.extentions import parse_json_form, validation, parse_list_args2
from library.api.render impor... | from flask import request
from apps.auth.auth_require import required
from apps.project.business.issue import IssueBusiness, IssueRecordBusiness, IssueDashBoardBusiness
from apps.project.extentions import parse_json_form, validation, parse_list_args2
from library.api.render import json_detail_render, json_list_render2... | en | 0.223038 | # 新增issue @api {post} /v1/issue 新增 缺陷 @apiName CreateIssue @apiGroup 项目 @apiDescription 新增 缺陷 @apiParam {int} module_id 模块 ID @apiParam {int} handler 处理人 ID @apiParam {int} issue_type 类型 @apiParam {int} chance 出现几率 @apiParam {int} level 级别 @apiParam {int} priority 优先级 @apiParam {... | 2.221668 | 2 |
PhysicsTools/PythonAnalysis/python/ParticleDecayDrawer.py | nistefan/cmssw | 0 | 10321 | # <NAME>, DESY
# <EMAIL>
#
# this tool is based on Luca Lista's tree drawer module
class ParticleDecayDrawer(object):
"""Draws particle decay tree """
def __init__(self):
print "Init particleDecayDrawer"
# booleans: printP4 printPtEtaPhi printVertex
def _accept(self, cand... | # <NAME>, DESY
# <EMAIL>
#
# this tool is based on Luca Lista's tree drawer module
class ParticleDecayDrawer(object):
"""Draws particle decay tree """
def __init__(self):
print "Init particleDecayDrawer"
# booleans: printP4 printPtEtaPhi printVertex
def _accept(self, cand... | en | 0.722725 | # <NAME>, DESY # <EMAIL> # # this tool is based on Luca Lista's tree drawer module Draws particle decay tree # booleans: printP4 printPtEtaPhi printVertex # here the part about the names :-( draw decay tree from list(HepMC.GenParticles) # != None ): | 2.957251 | 3 |
translator.py | liuprestin/pyninjaTUT-translator | 0 | 10322 | <gh_stars>0
from translate import Translator
translator = Translator(to_lang="zh")
try:
with open('./example.md', mode='r') as in_file:
text = in_file.read()
with open('./example-tranlated.md', mode='w') as trans_file:
trans_file.write(translator.translate(text))
except FileNotF... | from translate import Translator
translator = Translator(to_lang="zh")
try:
with open('./example.md', mode='r') as in_file:
text = in_file.read()
with open('./example-tranlated.md', mode='w') as trans_file:
trans_file.write(translator.translate(text))
except FileNotFoundError as... | none | 1 | 3.014315 | 3 | |
reddit2telegram/channels/news/app.py | mainyordle/reddit2telegram | 187 | 10323 | #encoding:utf-8
from utils import weighted_random_subreddit
t_channel = '@news756'
subreddit = weighted_random_subreddit({
'politics': 0.5,
'news': 0.5
})
def send_post(submission, r2t):
return r2t.send_simple(submission,
text='{title}\n\n{self_text}\n\n/r/{subreddit_name}\n{short_link}',
... | #encoding:utf-8
from utils import weighted_random_subreddit
t_channel = '@news756'
subreddit = weighted_random_subreddit({
'politics': 0.5,
'news': 0.5
})
def send_post(submission, r2t):
return r2t.send_simple(submission,
text='{title}\n\n{self_text}\n\n/r/{subreddit_name}\n{short_link}',
... | en | 0.735217 | #encoding:utf-8 | 2.509786 | 3 |
xcbgen/xtypes.py | tizenorg/framework.uifw.xorg.xcb.xcb-proto | 1 | 10324 | '''
This module contains the classes which represent XCB data types.
'''
from xcbgen.expr import Field, Expression
import __main__
class Type(object):
'''
Abstract base class for all XCB data types.
Contains default fields, and some abstract methods.
'''
def __init__(self, name):
'''
... | '''
This module contains the classes which represent XCB data types.
'''
from xcbgen.expr import Field, Expression
import __main__
class Type(object):
'''
Abstract base class for all XCB data types.
Contains default fields, and some abstract methods.
'''
def __init__(self, name):
'''
... | en | 0.850046 | This module contains the classes which represent XCB data types. Abstract base class for all XCB data types. Contains default fields, and some abstract methods. Default structure initializer. Sets up default fields. Public fields: name is a tuple of strings specifying the full type name. s... | 3.120223 | 3 |
BioKlustering-Website/mlmodel/parser/kmeans.py | solislemuslab/mycovirus-website | 1 | 10325 | # Copyright 2020 by <NAME>, Solis-Lemus Lab, WID.
# All rights reserved.
# This file is part of the BioKlustering Website.
import pandas as pd
from Bio import SeqIO
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.cluster ... | # Copyright 2020 by <NAME>, Solis-Lemus Lab, WID.
# All rights reserved.
# This file is part of the BioKlustering Website.
import pandas as pd
from Bio import SeqIO
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.cluster ... | en | 0.861432 | # Copyright 2020 by <NAME>, Solis-Lemus Lab, WID. # All rights reserved. # This file is part of the BioKlustering Website. # credit to chunrong # convert all clusters into two clusters | 2.48096 | 2 |
workflow/src/routing.py | mibexsoftware/alfred-stash-workflow | 13 | 10326 | # -*- coding: utf-8 -*-
from src import icons, __version__
from src.actions import HOST_URL
from src.actions.configure import ConfigureWorkflowAction
from src.actions.help import HelpWorkflowAction
from src.actions.index import IndexWorkflowAction
from src.actions.projects import ProjectWorkflowAction
from src.actions.... | # -*- coding: utf-8 -*-
from src import icons, __version__
from src.actions import HOST_URL
from src.actions.configure import ConfigureWorkflowAction
from src.actions.help import HelpWorkflowAction
from src.actions.index import IndexWorkflowAction
from src.actions.projects import ProjectWorkflowAction
from src.actions.... | en | 0.451041 | # -*- coding: utf-8 -*- # e.g., args = ":config sethost http://localhost,--exec" # :config sethost http://localhost # show menu | 1.983528 | 2 |
model/model.py | CaoHoangTung/shark-cop-server | 2 | 10327 | <reponame>CaoHoangTung/shark-cop-server
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from sklearn.metrics import classification_report, confusion_matrix
from mlxtend.plotting import plot_decision_regions
# from sk... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from sklearn.metrics import classification_report, confusion_matrix
from mlxtend.plotting import plot_decision_regions
# from sklearn import datasets
from pandas.plotti... | en | 0.215857 | # from sklearn import datasets # print("X=%s, Predicted=%s" % (test_2d, y_pred_test[0])) # print(y_pred.shape) # TESTING ZONE | 2.818171 | 3 |
PE032.py | CaptainSora/Python-Project-Euler | 0 | 10328 | from itertools import count
from _pandigital_tools import is_pandigital
def pand_products():
"""
Returns the sum of all numbers n which have a factorization a * b = n such
that a, b, n are (cumulatively) 1 through 9 pandigital.
"""
total = set()
for a in range(2, 100):
for b in count(... | from itertools import count
from _pandigital_tools import is_pandigital
def pand_products():
"""
Returns the sum of all numbers n which have a factorization a * b = n such
that a, b, n are (cumulatively) 1 through 9 pandigital.
"""
total = set()
for a in range(2, 100):
for b in count(... | en | 0.940235 | Returns the sum of all numbers n which have a factorization a * b = n such that a, b, n are (cumulatively) 1 through 9 pandigital. | 3.675899 | 4 |
v1/models.py | jdubansky/openstates.org | 1 | 10329 | from django.db import models
from openstates.data.models import Bill
class LegacyBillMapping(models.Model):
legacy_id = models.CharField(max_length=20, primary_key=True)
bill = models.ForeignKey(
Bill, related_name="legacy_mapping", on_delete=models.CASCADE
)
| from django.db import models
from openstates.data.models import Bill
class LegacyBillMapping(models.Model):
legacy_id = models.CharField(max_length=20, primary_key=True)
bill = models.ForeignKey(
Bill, related_name="legacy_mapping", on_delete=models.CASCADE
)
| none | 1 | 2.05028 | 2 | |
corehq/apps/accounting/utils.py | satyaakam/commcare-hq | 0 | 10330 | <filename>corehq/apps/accounting/utils.py
import datetime
import logging
from collections import defaultdict, namedtuple
from django.conf import settings
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django_prbac.models... | <filename>corehq/apps/accounting/utils.py
import datetime
import logging
from collections import defaultdict, namedtuple
from django.conf import settings
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django_prbac.models... | en | 0.915255 | This will be turned into a JSON representation of this Feature and its FeatureRate This will be turned into a JSON representation of this SoftwareProductRate Adds a parameterless grant between grantee and priv, looked up by slug. :param grants_to_privs: An iterable of two-tuples: `(grantee_slug, priv_slugs)`. ... | 1.984207 | 2 |
RSA/Algorithm/EEA.py | Pumpkin-NN/Cryptography | 0 | 10331 | <filename>RSA/Algorithm/EEA.py
def extended_euclidean_algorithm(a, b):
# Initial s = 1
s = 1
list_s = []
list_t = []
# Algorithm
while b > 0:
# Find the remainder of a, b
r = a % b
if r > 0:
# The t expression
t = (r - (a * s)) // b
li... | <filename>RSA/Algorithm/EEA.py
def extended_euclidean_algorithm(a, b):
# Initial s = 1
s = 1
list_s = []
list_t = []
# Algorithm
while b > 0:
# Find the remainder of a, b
r = a % b
if r > 0:
# The t expression
t = (r - (a * s)) // b
li... | en | 0.764078 | # Initial s = 1 # Algorithm # Find the remainder of a, b # The t expression # Use b to be the new a # Use the remainder to be the new b # Find the coefficients s and t # Find the coefficient t # Find the coefficient s | 3.382838 | 3 |
hci/command/commands/le_apcf_commands/apcf_service_data.py | cc4728/python-hci | 3 | 10332 | from ..le_apcf_command_pkt import LE_APCF_Command
from struct import pack, unpack
from enum import IntEnum
"""
This pare base on spec <<Android BT HCI Requirement for BLE feature>> v0.52
Advertisement Package Content filter
"""
class APCF_Service_Data(LE_APCF_Command):
def __init__(self):
# TODO generate... | from ..le_apcf_command_pkt import LE_APCF_Command
from struct import pack, unpack
from enum import IntEnum
"""
This pare base on spec <<Android BT HCI Requirement for BLE feature>> v0.52
Advertisement Package Content filter
"""
class APCF_Service_Data(LE_APCF_Command):
def __init__(self):
# TODO generate... | en | 0.335834 | This pare base on spec <<Android BT HCI Requirement for BLE feature>> v0.52 Advertisement Package Content filter # TODO generate cmd | 2.215252 | 2 |
source/documentModel/representations/DocumentNGramSymWinGraph.py | Vyvy-vi/Ngram-Graphs | 178 | 10333 | <gh_stars>100-1000
"""
DocumentNGramSymWinGraph.py
Created on May 23, 2017, 4:56 PM
"""
import networkx as nx
import pygraphviz as pgv
import matplotlib.pyplot as plt
from networkx.drawing.nx_agraph import graphviz_layout
from DocumentNGramGraph import DocumentNGramGraph
class DocumentNGramSymWinGraph(Documen... | """
DocumentNGramSymWinGraph.py
Created on May 23, 2017, 4:56 PM
"""
import networkx as nx
import pygraphviz as pgv
import matplotlib.pyplot as plt
from networkx.drawing.nx_agraph import graphviz_layout
from DocumentNGramGraph import DocumentNGramGraph
class DocumentNGramSymWinGraph(DocumentNGramGraph):
#... | en | 0.845614 | DocumentNGramSymWinGraph.py Created on May 23, 2017, 4:56 PM # an extension of DocumentNGramGraph # for symmetric windowing # set Data @class_variable # build ngram # calculate window # initialize graph # max possible window size (bounded by win) # first build the full window # if window's edge has reached # it's t... | 2.929513 | 3 |
examples/EC2Conditions.py | DrLuke/troposphere | 1 | 10334 | from __future__ import print_function
from troposphere import (
Template, Parameter, Ref, Condition, Equals, And, Or, Not, If
)
from troposphere import ec2
parameters = {
"One": Parameter(
"One",
Type="String",
),
"Two": Parameter(
"Two",
Type="String",
),
"Thr... | from __future__ import print_function
from troposphere import (
Template, Parameter, Ref, Condition, Equals, And, Or, Not, If
)
from troposphere import ec2
parameters = {
"One": Parameter(
"One",
Type="String",
),
"Two": Parameter(
"Two",
Type="String",
),
"Thr... | none | 1 | 2.65585 | 3 | |
fist_phase/08_objects.py | kapuni/exercise_py | 0 | 10335 | class Student(object):
# __init__是一个特殊方法用于在创建对象时进行初始化操作
# 通过这个方法我们可以为学生对象绑定name和age两个属性
def __init__(self, name, age):
self.name = name
self.age = age
def study(self, course_name):
print('%s正在学习%s.' % (self.name, course_name))
# PEP 8要求标识符的名字用全小写多个单词用下划线连接
# 但是部分程序员和公司... | class Student(object):
# __init__是一个特殊方法用于在创建对象时进行初始化操作
# 通过这个方法我们可以为学生对象绑定name和age两个属性
def __init__(self, name, age):
self.name = name
self.age = age
def study(self, course_name):
print('%s正在学习%s.' % (self.name, course_name))
# PEP 8要求标识符的名字用全小写多个单词用下划线连接
# 但是部分程序员和公司... | zh | 0.981659 | # __init__是一个特殊方法用于在创建对象时进行初始化操作 # 通过这个方法我们可以为学生对象绑定name和age两个属性 # PEP 8要求标识符的名字用全小写多个单词用下划线连接 # 但是部分程序员和公司更倾向于使用驼峰命名法(驼峰标识) # 创建学生对象并指定姓名和年龄 # 给对象发study消息 # 给对象发watch_av消息 | 4.038315 | 4 |
lrtc_lib/data/load_dataset.py | MovestaDev/low-resource-text-classification-framework | 57 | 10336 | # (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import logging
from lrtc_lib.data_access import single_dataset_loader
from lrtc_lib.data_access.processors.dataset_part import DatasetPart
from lrtc_lib.oracle_data_access import gold_labels_... | # (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import logging
from lrtc_lib.data_access import single_dataset_loader
from lrtc_lib.data_access.processors.dataset_part import DatasetPart
from lrtc_lib.oracle_data_access import gold_labels_... | en | 0.45673 | # (c) Copyright IBM Corporation 2020. # LICENSE: Apache License 2.0 (Apache-2.0) # http://www.apache.org/licenses/LICENSE-2.0 # load dataset (generate Documents and TextElements) # load gold labels | 2.109836 | 2 |
graphql_compiler/compiler/emit_match.py | BarracudaPff/code-golf-data-pythpn | 0 | 10337 | <reponame>BarracudaPff/code-golf-data-pythpn
"""Convert lowered IR basic blocks to MATCH query strings."""
from collections import deque
import six
from .blocks import Filter, MarkLocation, QueryRoot, Recurse, Traverse
from .expressions import TrueLiteral
from .helpers import get_only_element_from_collection, validate_... | """Convert lowered IR basic blocks to MATCH query strings."""
from collections import deque
import six
from .blocks import Filter, MarkLocation, QueryRoot, Recurse, Traverse
from .expressions import TrueLiteral
from .helpers import get_only_element_from_collection, validate_safe_string
def _get_vertex_location_name(loc... | en | 0.82796 | Convert lowered IR basic blocks to MATCH query strings. Get the location name from a location that is expected to point to a vertex. Transform the very first MATCH step into a MATCH query string. Transform any subsequent (non-first) MATCH step into a MATCH query string. Emit MATCH query code for an entire MATCH travers... | 2.736345 | 3 |
mo_leduc.py | mohamedun/Deep-CFR | 0 | 10338 | <gh_stars>0
from PokerRL.game.games import StandardLeduc
from PokerRL.game.games import BigLeduc
from PokerRL.eval.rl_br.RLBRArgs import RLBRArgs
from PokerRL.eval.lbr.LBRArgs import LBRArgs
from PokerRL.game.bet_sets import POT_ONLY
from DeepCFR.EvalAgentDeepCFR import EvalAgentDeepCFR
from DeepCFR.TrainingProfile imp... | from PokerRL.game.games import StandardLeduc
from PokerRL.game.games import BigLeduc
from PokerRL.eval.rl_br.RLBRArgs import RLBRArgs
from PokerRL.eval.lbr.LBRArgs import LBRArgs
from PokerRL.game.bet_sets import POT_ONLY
from DeepCFR.EvalAgentDeepCFR import EvalAgentDeepCFR
from DeepCFR.TrainingProfile import Training... | en | 0.785843 | # warm start neural weights with init from last iter # shallower nets # shallower nets # You can specify one or both modes. Choosing both is useful to compare them. # SD-CFR # Training # The DDQN #'rlbr': 1, | 1.854403 | 2 |
geocircles/backend/gamestate.py | tmick0/geocircles | 0 | 10339 | <gh_stars>0
import sqlite3
from enum import Enum
import random
__all__ = ['state_mgr', 'game_state', 'next_state']
class game_state (Enum):
NEW_GAME = 0
WAITING_FOR_HOST = 1
HOST_CHOOSING = 2
GUEST_GUESSING = 3
GUEST_CHOOSING = 4
HOST_GUESSING = 5
def next_state(s):
if s == game_state.W... | import sqlite3
from enum import Enum
import random
__all__ = ['state_mgr', 'game_state', 'next_state']
class game_state (Enum):
NEW_GAME = 0
WAITING_FOR_HOST = 1
HOST_CHOOSING = 2
GUEST_GUESSING = 3
GUEST_CHOOSING = 4
HOST_GUESSING = 5
def next_state(s):
if s == game_state.WAITING_FOR_H... | en | 0.619007 | create table if not exists game ( game_id integer primary key, state integer default {:d} ) create table if not exists session ( session_id integer primary key, game_id integer not null references game (game_id), position integer not null, ... | 3.070557 | 3 |
tests/unit/providers/callables/__init__.py | YelloFam/python-dependency-injector | 0 | 10340 | <filename>tests/unit/providers/callables/__init__.py<gh_stars>0
"""Tests for callables."""
| <filename>tests/unit/providers/callables/__init__.py<gh_stars>0
"""Tests for callables."""
| en | 0.836076 | Tests for callables. | 1.311692 | 1 |
dss/dss_capi_gr/__init__.py | dss-extensions/dss_python | 24 | 10341 | <gh_stars>10-100
'''
A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
Copyright (c) 2016-2019 <NAME>
'''
from __future__ import absolute_import
from .IDSS import IDSS
| '''
A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
Copyright (c) 2016-2019 <NAME>
'''
from __future__ import absolute_import
from .IDSS import IDSS | en | 0.681156 | A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface. Copyright (c) 2016-2019 <NAME> | 0.853135 | 1 |
museflow/components/embedding_layer.py | BILLXZY1215/museflow | 0 | 10342 | from .component import Component, using_scope
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
class EmbeddingLayer(Component):
def __init__(self, input_size, output_size, name='embedding'):
Component.__init__(self, name=name)
self.input_size = input_size
self.output_size = out... | from .component import Component, using_scope
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
class EmbeddingLayer(Component):
def __init__(self, input_size, output_size, name='embedding'):
Component.__init__(self, name=name)
self.input_size = input_size
self.output_size = out... | none | 1 | 2.671676 | 3 | |
hydrocarbon_problem/env/__init__.py | lollcat/Aspen-RL | 1 | 10343 | from hydrocarbon_problem.env.types_ import Observation, Done, Stream, Column | from hydrocarbon_problem.env.types_ import Observation, Done, Stream, Column | none | 1 | 1.01272 | 1 | |
addon_common/common/decorators.py | Unnoen/retopoflow | 1 | 10344 | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
<EMAIL>
Created by <NAME>, <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your op... | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
<EMAIL>
Created by <NAME>, <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your op... | en | 0.79794 | Copyright (C) 2021 CG Cookie http://cgcookie.com <EMAIL> Created by <NAME>, <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option... | 2.131099 | 2 |
venv/Lib/site-packages/pandas/tests/window/moments/test_moments_consistency_ewm.py | ajayiagbebaku/NFL-Model | 28,899 | 10345 | import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
concat,
)
import pandas._testing as tm
@pytest.mark.parametrize("func", ["cov", "corr"])
def test_ewm_pairwise_cov_corr(func, frame):
result = getattr(frame.ewm(span=10, min_periods=5), func)()
result = result.loc[(slice(Non... | import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
concat,
)
import pandas._testing as tm
@pytest.mark.parametrize("func", ["cov", "corr"])
def test_ewm_pairwise_cov_corr(func, frame):
result = getattr(frame.ewm(span=10, min_periods=5), func)()
result = result.loc[(slice(Non... | en | 0.855206 | # GH 7898 # binary functions (ewmcov, ewmcorr) with bias=False require at # least two values # check series of length 0 # check series of length 1 # exception raised is Exception # check that correlation of a series with itself is either 1 or NaN # check mean of constant series # check correlation of constant series wi... | 2.343834 | 2 |
brainex/query.py | ebuntel/BrainExTemp | 1 | 10346 |
# TODO finish implementing query
import math
from pyspark import SparkContext
# from genex.cluster import sim_between_seq
from brainex.op.query_op import sim_between_seq
from brainex.parse import strip_function, remove_trailing_zeros
from .classes import Sequence
from brainex.database import genexengine
def query(... |
# TODO finish implementing query
import math
from pyspark import SparkContext
# from genex.cluster import sim_between_seq
from brainex.op.query_op import sim_between_seq
from brainex.parse import strip_function, remove_trailing_zeros
from .classes import Sequence
from brainex.database import genexengine
def query(... | en | 0.675752 | # TODO finish implementing query # from genex.cluster import sim_between_seq :param q: query sequence :param gc: Gcluster in which to query :param loi: list of two integer values, specifying the query range, if set to None, is going to query all length :param sc: spark context on which to run the query oper... | 2.598485 | 3 |
main.py | orgr/arbitrage_bot | 0 | 10347 | <gh_stars>0
import sys
import time
from typing import List
import asyncio
import ccxt.async_support as ccxt
# import ccxt
import itertools
from enum import Enum
class Color(Enum):
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
RESET = '\033[0m'
def colorize(s, color: Co... | import sys
import time
from typing import List
import asyncio
import ccxt.async_support as ccxt
# import ccxt
import itertools
from enum import Enum
class Color(Enum):
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
RESET = '\033[0m'
def colorize(s, color: Color):
#... | en | 0.631917 | # import ccxt # return color.value + s + Color.RESET.value # buy from other exchange # buy from this exchange # spread = (ask - bid) if (bid and ask) else None # print(ex.id, 'market price', {'bid': bid, 'ask': ask, 'spread': spread}) # initialize exchanges # type: ccxt.Exchange # ex.set_sandbox_mode(enabled=True) # cl... | 2.770407 | 3 |
examples/click-ninja/clickninja-final.py | predicatemike/predigame | 0 | 10348 | WIDTH = 20
HEIGHT = 14
TITLE = 'Click Ninja'
BACKGROUND = 'board'
def destroy(s):
sound('swoosh')
if s.name == 'taco':
score(50)
else:
score(5)
# draw a splatting image at the center position of the image
image('redsplat', center=s.event_pos, size=2).fade(1.0)
s.fade(0.25)
def ... | WIDTH = 20
HEIGHT = 14
TITLE = 'Click Ninja'
BACKGROUND = 'board'
def destroy(s):
sound('swoosh')
if s.name == 'taco':
score(50)
else:
score(5)
# draw a splatting image at the center position of the image
image('redsplat', center=s.event_pos, size=2).fade(1.0)
s.fade(0.25)
def ... | en | 0.850029 | # draw a splatting image at the center position of the image | 3.088893 | 3 |
nni/retiarii/hub/pytorch/nasbench201.py | nbl97/nni | 2,305 | 10349 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Callable, Dict
import torch
import torch.nn as nn
from nni.retiarii import model_wrapper
from nni.retiarii.nn.pytorch import NasBench201Cell
__all__ = ['NasBench201']
OPS_WITH_STRIDE = {
'none': lambda C_in, C_out, st... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Callable, Dict
import torch
import torch.nn as nn
from nni.retiarii import model_wrapper
from nni.retiarii.nn.pytorch import NasBench201Cell
__all__ = ['NasBench201']
OPS_WITH_STRIDE = {
'none': lambda C_in, C_out, st... | en | 0.783286 | # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # residual The full search space proposed by `NAS-Bench-201 <https://arxiv.org/abs/2001.00326>`__. It's a stack of :class:`NasBench201Cell`. | 1.929604 | 2 |
setup.py | Pasha13666/dialog_py | 1 | 10350 | #!/usr/bin/env python3
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='dialog_py',
version='1.0a1',
description='Python API for cdialog/linux dialog',
long_description=long_de... | #!/usr/bin/env python3
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='dialog_py',
version='1.0a1',
description='Python API for cdialog/linux dialog',
long_description=long_de... | fr | 0.221828 | #!/usr/bin/env python3 | 1.173689 | 1 |
test/test_who.py | rliebz/whoswho | 28 | 10351 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import nose
from nose.tools import *
from whoswho import who, config
from nameparser.config.titles import TITLES as NAMEPARSER_TITLES
class TestMatch(unittest.TestCase):
def setUp(self):
self.name = '<NAME>'
def test... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import nose
from nose.tools import *
from whoswho import who, config
from nameparser.config.titles import TITLES as NAMEPARSER_TITLES
class TestMatch(unittest.TestCase):
def setUp(self):
self.name = '<NAME>'
def test... | en | 0.824139 | # -*- coding: utf-8 -*- # Only relevant for python 2.X # TODO: Should these be true? # Only relevant for python 2.X # Suffix doesn't change a match # Title doesn't change a match # TODO: Should we ensure that the metadata is up to date? Check if list of titles is up to date with nameparser Check if list of suffixes is ... | 2.749582 | 3 |
endpoints/UserEndpoint.py | GardenersGalore/server | 0 | 10352 | import json
from flask import request
from flask_restful import Resource, abort, reqparse
from models.User import User
"""
POST Creates a new resource.
GET Retrieves a resource.
PUT Updates an existing resource.
DELETE Deletes a resource.
"""
class UserEndpoint(Resource)... | import json
from flask import request
from flask_restful import Resource, abort, reqparse
from models.User import User
"""
POST Creates a new resource.
GET Retrieves a resource.
PUT Updates an existing resource.
DELETE Deletes a resource.
"""
class UserEndpoint(Resource)... | en | 0.792861 | POST Creates a new resource. GET Retrieves a resource. PUT Updates an existing resource. DELETE Deletes a resource. # need to ensure the required fields are in the json # TODO # TODO | 3.0881 | 3 |
passy_forms/forms/forms.py | vleon1/passy | 0 | 10353 | <reponame>vleon1/passy
from django.forms import forms
class Form(forms.Form):
def get_value(self, name):
self.is_valid() # making sure we tried to clean the data before accessing it
if self.is_bound and name in self.cleaned_data:
return self.cleaned_data[name]
... | from django.forms import forms
class Form(forms.Form):
def get_value(self, name):
self.is_valid() # making sure we tried to clean the data before accessing it
if self.is_bound and name in self.cleaned_data:
return self.cleaned_data[name]
field = self[name]
... | en | 0.938686 | # making sure we tried to clean the data before accessing it | 2.848369 | 3 |
assignment4/rorxornotencode.py | gkweb76/SLAE | 15 | 10354 | <filename>assignment4/rorxornotencode.py<gh_stars>10-100
#!/usr/bin/python
# Title: ROR/XOR/NOT encoder
# File: rorxornotencode.py
# Author: <NAME>
# SLAE-681
import sys
ror = lambda val, r_bits, max_bits: \
((val & (2**max_bits-1)) >> r_bits%max_bits) | \
(val << (max_bits-(r_bits%max_bits)) & (2**max_bits-... | <filename>assignment4/rorxornotencode.py<gh_stars>10-100
#!/usr/bin/python
# Title: ROR/XOR/NOT encoder
# File: rorxornotencode.py
# Author: <NAME>
# SLAE-681
import sys
ror = lambda val, r_bits, max_bits: \
((val & (2**max_bits-1)) >> r_bits%max_bits) | \
(val << (max_bits-(r_bits%max_bits)) & (2**max_bits-... | en | 0.258869 | #!/usr/bin/python # Title: ROR/XOR/NOT encoder # File: rorxornotencode.py # Author: <NAME> # SLAE-681 # ROR & XOR encoding # NOT encoding | 2.582449 | 3 |
authalligator_client/entities.py | closeio/authalligator-client | 0 | 10355 | import datetime
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
import ciso8601
import structlog
from attr import converters
from . import enums
from .utils import as_json_dict, to_snake_case
logger = structlog.get_logger()
class Omitted(Enum):
... | import datetime
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
import ciso8601
import structlog
from attr import converters
from . import enums
from .utils import as_json_dict, to_snake_case
logger = structlog.get_logger()
class Omitted(Enum):
... | en | 0.804767 | Singleton written in a way mypy can parse. See https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions for more details. A singleton to differentiate between omitted vs explicit :obj:`None`. # helper type for entity_converter # type: Union[List[Type[U]], Type[U]] # type: (...) -> Callab... | 2.312008 | 2 |
library/device.py | lompal/USBIPManager | 24 | 10356 | <gh_stars>10-100
from library import config, ini, lang, log, performance, periphery, queue
from asyncio import get_event_loop
from threading import Thread, Event
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QTreeWidgetItem
# noinspection PyPep8Naming
class Signal(QObject):
""" PyQt si... | from library import config, ini, lang, log, performance, periphery, queue
from asyncio import get_event_loop
from threading import Thread, Event
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QTreeWidgetItem
# noinspection PyPep8Naming
class Signal(QObject):
""" PyQt signals for correct... | en | 0.766665 | # noinspection PyPep8Naming PyQt signals for correct daemon device tree calls from a different thread Load daemon as a top-level item - emit the signal Set incoming/outgoing bandwidth - emit the signal Set tooltip for a daemon during capturing operation - emit the signal Set status icon for a daemon during capturing op... | 2.424398 | 2 |
agent/minimax/submission.py | youkeyao/SJTU-CS410-Snakes-3V3-Group06 | 1 | 10357 | <reponame>youkeyao/SJTU-CS410-Snakes-3V3-Group06
DEPTH = 3
# Action
class Action:
top = [1, 0, 0, 0]
bottom = [0, 1, 0, 0]
left = [0, 0, 1, 0]
right = [0, 0, 0, 1]
actlist = [(-1, 0), (1, 0), (0, -1), (0, 1)]
mapAct = {
actlist[0]: top,
actlist[1]: bottom,
actlist[2]: le... | DEPTH = 3
# Action
class Action:
top = [1, 0, 0, 0]
bottom = [0, 1, 0, 0]
left = [0, 0, 1, 0]
right = [0, 0, 0, 1]
actlist = [(-1, 0), (1, 0), (0, -1), (0, 1)]
mapAct = {
actlist[0]: top,
actlist[1]: bottom,
actlist[2]: left,
actlist[3]: right
}
def go(s... | none | 1 | 3.439826 | 3 | |
public_html/python/Empty_Python_Page.py | Asher-Simcha/help | 0 | 10358 | <reponame>Asher-Simcha/help<filename>public_html/python/Empty_Python_Page.py
#!/usr/bin/pyton
# Title:
# Author:
# Additional Authors:
# Filename:
# Description:
# Version:
# Date:
# Last Modified:
# Location_of_the_Video:
# Meta_data_for_YouTube:
# Web_Site_For_Video:
# Start Your Code Here
#EOF
| #!/usr/bin/pyton
# Title:
# Author:
# Additional Authors:
# Filename:
# Description:
# Version:
# Date:
# Last Modified:
# Location_of_the_Video:
# Meta_data_for_YouTube:
# Web_Site_For_Video:
# Start Your Code Here
#EOF | en | 0.564956 | #!/usr/bin/pyton # Title: # Author: # Additional Authors: # Filename: # Description: # Version: # Date: # Last Modified: # Location_of_the_Video: # Meta_data_for_YouTube: # Web_Site_For_Video: # Start Your Code Here #EOF | 1.822273 | 2 |
Python/first_flask_project/utilities/file_reader.py | maxxxxxdlp/code_share | 0 | 10359 | <gh_stars>0
def read_csv(root, file_name, keys):
with open('{root}private_static/csv/{file_name}.csv'.format(root=root, file_name=file_name)) as file:
data = file.read()
lines = data.split("\n")
return [dict(zip(keys, line.split(','))) for i, line in enumerate(lines) if i != 0]
| def read_csv(root, file_name, keys):
with open('{root}private_static/csv/{file_name}.csv'.format(root=root, file_name=file_name)) as file:
data = file.read()
lines = data.split("\n")
return [dict(zip(keys, line.split(','))) for i, line in enumerate(lines) if i != 0] | none | 1 | 3.108223 | 3 | |
semester3/oop/lab3/parser/client/MasterService/client.py | no1sebomb/University-Labs | 0 | 10360 | <reponame>no1sebomb/University-Labs
# coding=utf-8
from parser.client import *
from parser.client.ResponseItem import *
with (Path(__file__).resolve().parent / "config.json").open("rt") as siteConfigFile:
SITE_CONFIG = json.load(siteConfigFile)
class MasterService(Client):
class Link:
main = "https... | # coding=utf-8
from parser.client import *
from parser.client.ResponseItem import *
with (Path(__file__).resolve().parent / "config.json").open("rt") as siteConfigFile:
SITE_CONFIG = json.load(siteConfigFile)
class MasterService(Client):
class Link:
main = "https://steering.com.ua/"
login =... | en | 0.644078 | # coding=utf-8 | 2.412715 | 2 |
sketchduino/template.py | rodrigopmatias/sketchduino | 0 | 10361 | # -*- coding: utf-8 -*-
'''
Copyright 2012 <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | # -*- coding: utf-8 -*-
'''
Copyright 2012 <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | en | 0.256779 | # -*- coding: utf-8 -*- Copyright 2012 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to... | 1.551507 | 2 |
Tic-Tac-Pi/gameObjects/TextObject.py | mstubinis/Tic-Tac-Pi | 2 | 10362 | <filename>Tic-Tac-Pi/gameObjects/TextObject.py<gh_stars>1-10
import pygame
from pygame.locals import *
import resourceManager
class TextObject(pygame.sprite.Sprite):
def __init__(self,pos,fontSize,fontcolor,textstring):
pygame.sprite.Sprite.__init__(self) #call Sprite initializer
self.position = p... | <filename>Tic-Tac-Pi/gameObjects/TextObject.py<gh_stars>1-10
import pygame
from pygame.locals import *
import resourceManager
class TextObject(pygame.sprite.Sprite):
def __init__(self,pos,fontSize,fontcolor,textstring):
pygame.sprite.Sprite.__init__(self) #call Sprite initializer
self.position = p... | en | 0.250797 | #call Sprite initializer | 2.851465 | 3 |
src/encoded/server_defaults.py | beta-cell-network/beta-cell-nw | 4 | 10363 | from datetime import datetime
from jsonschema_serialize_fork import NO_DEFAULT
from pyramid.security import effective_principals
from pyramid.threadlocal import get_current_request
from string import (
digits,
ascii_uppercase,
)
import random
import uuid
from snovault.schema_utils import server_default
A... | from datetime import datetime
from jsonschema_serialize_fork import NO_DEFAULT
from pyramid.security import effective_principals
from pyramid.threadlocal import get_current_request
from string import (
digits,
ascii_uppercase,
)
import random
import uuid
from snovault.schema_utils import server_default
A... | en | 0.510727 | # from jsonschema_serialize_fork date-time format requires a timezone # With 17 576 000 options Test accessions are generated on test.encodedcc.org | 1.962412 | 2 |
app/__init__.py | geirowew/SapAPI | 1 | 10364 | <reponame>geirowew/SapAPI
from flask import Flask
#from config import Config
import config
app = Flask(__name__)
#app.config.from_object(Config)
app.config.from_object(config)
#from app import routes
from app import gettoken | from flask import Flask
#from config import Config
import config
app = Flask(__name__)
#app.config.from_object(Config)
app.config.from_object(config)
#from app import routes
from app import gettoken | en | 0.138415 | #from config import Config #app.config.from_object(Config) #from app import routes | 1.745832 | 2 |
todo/task/__init__.py | BenMcLean981/flask-todo | 0 | 10365 | """Todo module."""
| """Todo module."""
| es | 0.59867 | Todo module. | 0.969902 | 1 |
src/pvt_model/pvt_system/pipe.py | BenWinchester/PVTModel | 1 | 10366 | <filename>src/pvt_model/pvt_system/pipe.py<gh_stars>1-10
#!/usr/bin/python3.7
########################################################################################
# pvt_collector/pipe.py - Represents a pipe within the system.
#
# Author: <NAME>
# Copyright: <NAME>, 2021
#############################################... | <filename>src/pvt_model/pvt_system/pipe.py<gh_stars>1-10
#!/usr/bin/python3.7
########################################################################################
# pvt_collector/pipe.py - Represents a pipe within the system.
#
# Author: <NAME>
# Copyright: <NAME>, 2021
#############################################... | de | 0.32294 | #!/usr/bin/python3.7 ######################################################################################## # pvt_collector/pipe.py - Represents a pipe within the system. # # Author: <NAME> # Copyright: <NAME>, 2021 ######################################################################################## The pipe modu... | 2.67348 | 3 |
tests/test_api_account_state.py | luisparravicini/ioapi | 0 | 10367 | import unittest
import os
import json
import requests
import requests_mock
from ioapi import api_url, IOService, AuthorizationError, UnexpectedResponseCodeError
class APIAccountStateTestCase(unittest.TestCase):
def setUp(self):
self.service = IOService()
@requests_mock.mock()
def test_account_st... | import unittest
import os
import json
import requests
import requests_mock
from ioapi import api_url, IOService, AuthorizationError, UnexpectedResponseCodeError
class APIAccountStateTestCase(unittest.TestCase):
def setUp(self):
self.service = IOService()
@requests_mock.mock()
def test_account_st... | en | 0.763347 | # skip 401 status code (unauthorized) | 2.69041 | 3 |
testData/devSeedData.py | bgporter/wastebook | 0 | 10368 | '''
fake posts to bootstrap a development database. Put any interesting cases
useful for development in here.
'''
from datetime import datetime
POST_DATA_1 = [
{
"created" : datetime(2015, 10, 1),
"published": datetime(2015, 10, 1),
"edited": datetime(2015, 10, 1),
"rende... | '''
fake posts to bootstrap a development database. Put any interesting cases
useful for development in here.
'''
from datetime import datetime
POST_DATA_1 = [
{
"created" : datetime(2015, 10, 1),
"published": datetime(2015, 10, 1),
"edited": datetime(2015, 10, 1),
"rende... | en | 0.366718 | fake posts to bootstrap a development database. Put any interesting cases useful for development in here. #foo #bar", #secret #post", #draft #post", #draft #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret #post", #secret ... | 2.63783 | 3 |
customer_support/utils.py | rtnpro/django-customer-support | 1 | 10369 | from __future__ import absolute_import
from django.shortcuts import render
import simplejson
import datetime
from django.http import HttpResponse
class GenericItemBase(object):
ITEM_ATTRS = []
def __init__(self, identifier):
self.identifier = identifier
def jsonify(self, value):
"""
... | from __future__ import absolute_import
from django.shortcuts import render
import simplejson
import datetime
from django.http import HttpResponse
class GenericItemBase(object):
ITEM_ATTRS = []
def __init__(self, identifier):
self.identifier = identifier
def jsonify(self, value):
"""
... | en | 0.544425 | Method to convert non JSON serializable objects into an equivalent JSON serializable form. | 2.325929 | 2 |
tobit.py | AlvaroCorrales/tobit | 1 | 10370 | import math
import warnings
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import scipy.stats
from scipy.stats import norm # edit
from scipy.special import log_ndtr
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, mean_absolute_error
def sp... | import math
import warnings
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import scipy.stats
from scipy.stats import norm # edit
from scipy.special import log_ndtr
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, mean_absolute_error
def sp... | en | 0.78234 | # edit # s = math.exp(params[-1]) # log_ndtr(concat_stats) # s = math.exp(params[-1]) # in censReg, not using chain rule as below; they optimize in terms of log(s) # by chain rule, since the expression above is dloglik/dlogsigma Fit a maximum-likelihood Tobit regression :param x: Pandas DataFrame (n_samples, n_... | 2.608687 | 3 |
setup.py | Raymond38324/hagworm | 0 | 10371 | <filename>setup.py
# -*- coding: utf-8 -*-
import setuptools
with open(r'README.md', r'r', encoding="utf8") as stream:
long_description = stream.read()
setuptools.setup(
name=r'hagworm',
version=r'3.0.0',
license=r'Apache License Version 2.0',
platforms=[r'all'],
author=r'Shaobo.Wang',
au... | <filename>setup.py
# -*- coding: utf-8 -*-
import setuptools
with open(r'README.md', r'r', encoding="utf8") as stream:
long_description = stream.read()
setuptools.setup(
name=r'hagworm',
version=r'3.0.0',
license=r'Apache License Version 2.0',
platforms=[r'all'],
author=r'Shaobo.Wang',
au... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.363825 | 1 |
mercury_ml/keras/containers.py | gabrieloexle/mercury-ml | 0 | 10372 | """
Simple IoC containers that provide direct access to various Keras providers
"""
class ModelSavers:
from mercury_ml.keras.providers import model_saving
save_hdf5 = model_saving.save_keras_hdf5
save_tensorflow_graph = model_saving.save_tensorflow_graph
save_tensorrt_pbtxt_config = model_saving.save_... | """
Simple IoC containers that provide direct access to various Keras providers
"""
class ModelSavers:
from mercury_ml.keras.providers import model_saving
save_hdf5 = model_saving.save_keras_hdf5
save_tensorflow_graph = model_saving.save_tensorflow_graph
save_tensorrt_pbtxt_config = model_saving.save_... | en | 0.849501 | Simple IoC containers that provide direct access to various Keras providers # these are just two small example model definitions. Users should define their own models # to use as follows: # >>> ModelDefinitions.my_model = my_model_module.define_model | 2.410166 | 2 |
Code Injector/code_injector_BeEF.py | crake7/Defensor-Fortis- | 0 | 10373 | #!/usr/bin/env python
import netfilterqueue
import scapy.all as scapy
import re
def set_load(packet, load):
packet[scapy.Raw].load = load
del packet[scapy.IP].len
del packet[scapy.IP].chksum
del packet[scapy.TCP].chksum
return packet
def process_packet(packet):
"""Modify downloads files on t... | #!/usr/bin/env python
import netfilterqueue
import scapy.all as scapy
import re
def set_load(packet, load):
packet[scapy.Raw].load = load
del packet[scapy.IP].len
del packet[scapy.IP].chksum
del packet[scapy.TCP].chksum
return packet
def process_packet(packet):
"""Modify downloads files on t... | en | 0.540625 | #!/usr/bin/env python Modify downloads files on the fly while target uses HTTP/HTTPS. Do not forget to choose the port you will use on line 23 and 28 and uncomment them. #try: #.decode() in load #CHOOSE PORT HERE: 80 / 10000: # print(scapy_packet.show()) #CHOOSE PORT HERE: 80 / 10000: #print(scapy_packet.show()) #e... | 2.87551 | 3 |
pycardcast/net/aiohttp.py | Elizafox/pycardcast | 0 | 10374 | # Copyright © 2015 <NAME>.
# All rights reserved.
# This file is part of the pycardcast project. See LICENSE in the root
# directory for licensing information.
import asyncio
import aiohttp
from pycardcast.net import CardcastAPIBase
from pycardcast.deck import (DeckInfo, DeckInfoNotFoundError,
... | # Copyright © 2015 <NAME>.
# All rights reserved.
# This file is part of the pycardcast project. See LICENSE in the root
# directory for licensing information.
import asyncio
import aiohttp
from pycardcast.net import CardcastAPIBase
from pycardcast.deck import (DeckInfo, DeckInfoNotFoundError,
... | en | 0.705087 | # Copyright © 2015 <NAME>. # All rights reserved. # This file is part of the pycardcast project. See LICENSE in the root # directory for licensing information. A :py:class:`~pycardcast.net.CardcastAPIBase` implementation using the aiohttp library. All the methods here are coroutines except for one: :py:met... | 2.503793 | 3 |
libtiepie/triggeroutput.py | TiePie/python-libtiepie | 6 | 10375 | <gh_stars>1-10
from ctypes import *
from .api import api
from .const import *
from .library import library
class TriggerOutput(object):
""""""
def __init__(self, handle, index):
self._handle = handle
self._index = index
def _get_enabled(self):
""" Check whether a trigger output i... | from ctypes import *
from .api import api
from .const import *
from .library import library
class TriggerOutput(object):
""""""
def __init__(self, handle, index):
self._handle = handle
self._index = index
def _get_enabled(self):
""" Check whether a trigger output is enabled. """
... | en | 0.657242 | Check whether a trigger output is enabled. Supported trigger output events. Currently selected trigger output event. Id. Name. Trigger the specified device trigger output. :returns: ``True`` if successful, ``False`` otherwise. .. versionadded:: 0.6 | 2.331322 | 2 |
conduit_rest/radish/conduit_rest_steps.py | dduleba/tw2019-ui-tests | 1 | 10376 | import time
from faker import Faker
from radish_ext.radish.step_config import StepConfig
from conduit.client import ConduitClient, ConduitConfig
class ConduitStepsConfig(StepConfig):
def __init__(self, context):
super().__init__(context)
self._faker = None
self.client = ConduitClient(Co... | import time
from faker import Faker
from radish_ext.radish.step_config import StepConfig
from conduit.client import ConduitClient, ConduitConfig
class ConduitStepsConfig(StepConfig):
def __init__(self, context):
super().__init__(context)
self._faker = None
self.client = ConduitClient(Co... | en | 0.981775 | created User | 2.264311 | 2 |
SummaryExternalClient.py | Hackillinois2k18/Main-Repo | 5 | 10377 | <filename>SummaryExternalClient.py<gh_stars>1-10
import requests
import credentials
class SummaryExternalClient:
def pullSummaryForUrl(self, artUrl, title):
url = "https://api.aylien.com/api/v1/summarize"
headers = {"X-AYLIEN-TextAPI-Application-Key": credentials.AYLIEN_APP_KEY,
... | <filename>SummaryExternalClient.py<gh_stars>1-10
import requests
import credentials
class SummaryExternalClient:
def pullSummaryForUrl(self, artUrl, title):
url = "https://api.aylien.com/api/v1/summarize"
headers = {"X-AYLIEN-TextAPI-Application-Key": credentials.AYLIEN_APP_KEY,
... | none | 1 | 3.048499 | 3 | |
tests/test_render.py | isuruf/conda-build | 0 | 10378 | import os
import sys
from conda_build import api
from conda_build import render
import pytest
def test_output_with_noarch_says_noarch(testing_metadata):
testing_metadata.meta['build']['noarch'] = 'python'
output = api.get_output_file_path(testing_metadata)
assert os.path.sep + "noarch" + os.path.sep in o... | import os
import sys
from conda_build import api
from conda_build import render
import pytest
def test_output_with_noarch_says_noarch(testing_metadata):
testing_metadata.meta['build']['noarch'] = 'python'
output = api.get_output_file_path(testing_metadata)
assert os.path.sep + "noarch" + os.path.sep in o... | none | 1 | 2.063212 | 2 | |
ABC/007/b.py | fumiyanll23/AtCoder | 0 | 10379 | <reponame>fumiyanll23/AtCoder
def main():
# input
A = input()
# compute
# output
if A == 'a':
print(-1)
else:
print('a')
if __name__ == '__main__':
main()
| def main():
# input
A = input()
# compute
# output
if A == 'a':
print(-1)
else:
print('a')
if __name__ == '__main__':
main() | en | 0.213219 | # input # compute # output | 3.409334 | 3 |
SPAE/read_write.py | simon-schuler/SPAE | 0 | 10380 | #Writing MOOG parameter file for the parameter, abundance, and error calculations.
#The parameter file only needs to be written once, at beginning of the routine, because the output
#files are overwritten with each itereation of the routine, only minimal output data are needed.
#
#The user can choose to have the param... | #Writing MOOG parameter file for the parameter, abundance, and error calculations.
#The parameter file only needs to be written once, at beginning of the routine, because the output
#files are overwritten with each itereation of the routine, only minimal output data are needed.
#
#The user can choose to have the param... | en | 0.793189 | #Writing MOOG parameter file for the parameter, abundance, and error calculations. #The parameter file only needs to be written once, at beginning of the routine, because the output #files are overwritten with each itereation of the routine, only minimal output data are needed. # #The user can choose to have the parame... | 3.10529 | 3 |
lectures/optimization/optimization_plots.py | carolinalvarez/ose-course-scientific-computing | 0 | 10381 | <reponame>carolinalvarez/ose-course-scientific-computing<filename>lectures/optimization/optimization_plots.py
"""Plots for optimization lecture."""
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
def plot_contour(f, allvecs, legend_path):
"""Plot contour graph for function f."""
#... | """Plots for optimization lecture."""
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
def plot_contour(f, allvecs, legend_path):
"""Plot contour graph for function f."""
# Create array from values with at least two dimensions.
allvecs = np.atleast_2d(allvecs)
X, Y, Z = _g... | en | 0.762189 | Plots for optimization lecture. Plot contour graph for function f. # Create array from values with at least two dimensions. Create a grid for function f. # create data to visualize objective function # number of discretization points along the x-axis # number of discretization points along the x-axis # extreme points i... | 3.718405 | 4 |
gdsfactory/functions.py | simbilod/gdsfactory | 0 | 10382 | <reponame>simbilod/gdsfactory<gh_stars>0
"""All functions return a Component so you can easily pipe or compose them.
There are two types of functions:
- decorators: return the original component
- containers: return a new component
"""
from functools import lru_cache, partial
import numpy as np
from omegaconf impor... | """All functions return a Component so you can easily pipe or compose them.
There are two types of functions:
- decorators: return the original component
- containers: return a new component
"""
from functools import lru_cache, partial
import numpy as np
from omegaconf import OmegaConf
from pydantic import validate... | en | 0.634079 | All functions return a Component so you can easily pipe or compose them. There are two types of functions: - decorators: return the original component - containers: return a new component Return Component with a new port. Return component inside a new component with text geometry. Args: component: compon... | 3.036531 | 3 |
OverlayUFOs/Overlay UFOs.roboFontExt/lib/OverlayUFOs.py | connordavenport/fbOpenTools | 0 | 10383 | #coding=utf-8
from __future__ import division
"""
# OVERLAY UFOS
For anyone looking in here, sorry the code is so messy. This is a standalone version of a script with a lot of dependencies.
"""
import os
from AppKit import * #@PydevCodeAnalysisIgnore
from vanilla import * #@PydevCodeAnalysisIgnore
from mojo.drawingT... | #coding=utf-8
from __future__ import division
"""
# OVERLAY UFOS
For anyone looking in here, sorry the code is so messy. This is a standalone version of a script with a lot of dependencies.
"""
import os
from AppKit import * #@PydevCodeAnalysisIgnore
from vanilla import * #@PydevCodeAnalysisIgnore
from mojo.drawingT... | en | 0.706843 | #coding=utf-8 # OVERLAY UFOS For anyone looking in here, sorry the code is so messy. This is a standalone version of a script with a lot of dependencies. #@PydevCodeAnalysisIgnore #@PydevCodeAnalysisIgnore #from lib.tools.defaults import getDefaultColor #NSMiniControlSize An agnostic way to get a naked font. The tool ... | 1.961254 | 2 |
nautapy/__init__.py | armandofcom/nautapy | 25 | 10384 | <gh_stars>10-100
import os
appdata_path = os.path.expanduser("~/.local/share/nautapy")
os.makedirs(appdata_path, exist_ok=True)
| import os
appdata_path = os.path.expanduser("~/.local/share/nautapy")
os.makedirs(appdata_path, exist_ok=True) | none | 1 | 1.599525 | 2 | |
pyteamup/Calendar.py | LogicallyUnfit/pyTeamUp | 5 | 10385 | import requests
import json
import datetime
import sys
from dateutil.parser import parse as to_datetime
try:
import pandas as pd
except:
pass
from pyteamup.utils.utilities import *
from pyteamup.utils.constants import *
from pyteamup.Event import Event
class Calendar:
def __init__(self, cal_id, api_key):... | import requests
import json
import datetime
import sys
from dateutil.parser import parse as to_datetime
try:
import pandas as pd
except:
pass
from pyteamup.utils.utilities import *
from pyteamup.utils.constants import *
from pyteamup.Event import Event
class Calendar:
def __init__(self, cal_id, api_key):... | en | 0.769907 | Makes a request to the calendar to see if the api is valid Method allows bulk fetching of events that fall between the provided time frame. If None is provided then the current date -30 and +180 days is used. :param start_dt: if set as None then set as today minus 30 days :param end_dt: if lef... | 2.620274 | 3 |
configs/regnet.py | roatienza/agmax | 2 | 10386 |
from . import constant
parameters = {
'RegNet' : { "lr": 0.1, "epochs": 100, "weight_decay": 5e-5, "batch_size": 128, "nesterov": True, "init_backbone":True, "init_extractor":True,},
}
backbone_config = {
"RegNetX002" : {"channels": 3, "dropout": 0.2,},
"RegNetY004" : {"channels": ... |
from . import constant
parameters = {
'RegNet' : { "lr": 0.1, "epochs": 100, "weight_decay": 5e-5, "batch_size": 128, "nesterov": True, "init_backbone":True, "init_extractor":True,},
}
backbone_config = {
"RegNetX002" : {"channels": 3, "dropout": 0.2,},
"RegNetY004" : {"channels": ... | en | 0.534218 | # RegNetX002 # RegNetY004 | 1.667898 | 2 |
examples/ws2812/main.py | ivankravets/pumbaa | 69 | 10387 | <filename>examples/ws2812/main.py
#
# @section License
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017, <NAME>
#
# 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, i... | <filename>examples/ws2812/main.py
#
# @section License
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017, <NAME>
#
# 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, i... | en | 0.778273 | # # @section License # # The MIT License (MIT) # # Copyright (c) 2016-2017, <NAME> # # 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 without limitation the ri... | 2.348122 | 2 |
reports/urls.py | aysiu/manana | 9 | 10388 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('reports.views',
url(r'^index/*$', 'index'),
url(r'^dashboard/*$', 'dashboard'),
url(r'^$', 'index'),
url(r'^detail/(?P<serial>[^/]+)$', 'detail'),
url(r'^detailpkg/(?P<serial>[^/]+)/(?P<manifest_name>[^/]+)$', 'detail_pkg')... | from django.conf.urls import patterns, include, url
urlpatterns = patterns('reports.views',
url(r'^index/*$', 'index'),
url(r'^dashboard/*$', 'dashboard'),
url(r'^$', 'index'),
url(r'^detail/(?P<serial>[^/]+)$', 'detail'),
url(r'^detailpkg/(?P<serial>[^/]+)/(?P<manifest_name>[^/]+)$', 'detail_pkg')... | en | 0.75041 | # for compatibilty with MunkiReport scripts | 2.00458 | 2 |
BackEnd/venv/lib/python3.8/site-packages/pytest_flask/fixtures.py | MatheusBrodt/App_LabCarolVS | 0 | 10389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import multiprocessing
import pytest
import socket
import signal
import os
import logging
try:
from urllib2 import URLError, urlopen
except ImportError:
from urllib.error import URLError
from urllib.request import urlopen
from flask import _request... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import multiprocessing
import pytest
import socket
import signal
import os
import logging
try:
from urllib2 import URLError, urlopen
except ImportError:
from urllib.error import URLError
from urllib.request import urlopen
from flask import _request... | en | 0.691301 | #!/usr/bin/env python # -*- coding: utf-8 -*- A Flask test client. An instance of :class:`flask.testing.TestClient` by default. Uses to set a ``client`` class attribute to current Flask test client:: @pytest.mark.usefixtures('client_class') class TestView: def login(self, email, passwo... | 2.307237 | 2 |
tableauserverclient/server/endpoint/endpoint.py | jorwoods/server-client-python | 1 | 10390 | from .exceptions import (
ServerResponseError,
InternalServerError,
NonXMLResponseError,
EndpointUnavailableError,
)
from functools import wraps
from xml.etree.ElementTree import ParseError
from ..query import QuerySet
import logging
try:
from distutils2.version import NormalizedVersion as Version
... | from .exceptions import (
ServerResponseError,
InternalServerError,
NonXMLResponseError,
EndpointUnavailableError,
)
from functools import wraps
from xml.etree.ElementTree import ParseError
from ..query import QuerySet
import logging
try:
from distutils2.version import NormalizedVersion as Version
... | en | 0.759296 | Checks if the server_response content is not xml (eg binary image or zip) and replaces it with a constant # This check is to determine if the response is a text response (xml or otherwise) # so that we do not attempt to log bytes and other binary data. # This will happen if we get a non-success HTTP code that #... | 2.39271 | 2 |
spec/test_importer.py | lajohnston/anki-freeplane | 15 | 10391 | import unittest
from freeplane_importer.importer import Importer
from mock import Mock
from mock import MagicMock
from mock import call
from freeplane_importer.model_not_found_exception import ModelNotFoundException
class TestImporter(unittest.TestCase):
def setUp(self):
self.mock_collection = Mock()
... | import unittest
from freeplane_importer.importer import Importer
from mock import Mock
from mock import MagicMock
from mock import call
from freeplane_importer.model_not_found_exception import ModelNotFoundException
class TestImporter(unittest.TestCase):
def setUp(self):
self.mock_collection = Mock()
... | none | 1 | 2.546978 | 3 | |
analysis/fitexp.py | mfkasim91/idcovid19 | 0 | 10392 | import argparse
import numpy as np
from scipy.stats import linregress
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument("--plot", action="store_const", default=False, const=True)
args = parser.parse_args()
data = np.loadtxt("../data/data.csv", skiprows=1, usecols=list(range(1,8)),... | import argparse
import numpy as np
from scipy.stats import linregress
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument("--plot", action="store_const", default=False, const=True)
args = parser.parse_args()
data = np.loadtxt("../data/data.csv", skiprows=1, usecols=list(range(1,8)),... | none | 1 | 2.924307 | 3 | |
.venv/lib/python3.7/site-packages/jedi/inference/lazy_value.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 76 | 10393 | <gh_stars>10-100
from jedi.inference.base_value import ValueSet, NO_VALUES
from jedi.common import monkeypatch
class AbstractLazyValue(object):
def __init__(self, data, min=1, max=1):
self.data = data
self.min = min
self.max = max
def __repr__(self):
return '<%s: %s>' % (self.... | from jedi.inference.base_value import ValueSet, NO_VALUES
from jedi.common import monkeypatch
class AbstractLazyValue(object):
def __init__(self, data, min=1, max=1):
self.data = data
self.min = min
self.max = max
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name_... | en | 0.894648 | data is a Value. data is a ValueSet. # We need to save the predefined names. It's an unfortunate side effect # that needs to be tracked otherwise results will be wrong. data is a list of lazy values. | 2.448808 | 2 |
percept/plot.py | joshleeb/PerceptronVis | 0 | 10394 | <filename>percept/plot.py
import matplotlib.lines as lines
import matplotlib.pyplot as plt
COLOR_CLASSIFICATIONS = [
'black', # Unclassified
'blue', # Classified True (1)
'red' # Classified False (0)
]
def generate_line(ax, p0, p1, color='black', style='-'):
'''
Generates a line betw... | <filename>percept/plot.py
import matplotlib.lines as lines
import matplotlib.pyplot as plt
COLOR_CLASSIFICATIONS = [
'black', # Unclassified
'blue', # Classified True (1)
'red' # Classified False (0)
]
def generate_line(ax, p0, p1, color='black', style='-'):
'''
Generates a line betw... | en | 0.891626 | # Unclassified # Classified True (1) # Classified False (0) Generates a line between points p0 and p1 which extends to be the width of the plot. Gets the function used to represent and plot the line representative by the perceptron's weights. The equation is: f(x) = -(w1/w2)x - w0/w2. Get's the color of the poi... | 3.863605 | 4 |
openpype/hosts/flame/api/lib.py | j-cube/OpenPype | 1 | 10395 | import sys
import os
import re
import json
import pickle
import tempfile
import itertools
import contextlib
import xml.etree.cElementTree as cET
from copy import deepcopy
from xml.etree import ElementTree as ET
from pprint import pformat
from .constants import (
MARKER_COLOR,
MARKER_DURATION,
MARKER_NAME,
... | import sys
import os
import re
import json
import pickle
import tempfile
import itertools
import contextlib
import xml.etree.cElementTree as cET
from copy import deepcopy
from xml.etree import ElementTree as ET
from pprint import pformat
from .constants import (
MARKER_COLOR,
MARKER_DURATION,
MARKER_NAME,
... | en | 0.641196 | # singleton used for passing data between api modules # flameAppFramework class takes care of preferences # don"t delegate w/ super - dict.copy() -> dict :( # self.prefs scope is limited to flame project and user # menu auto-refresh defaults # make sure the preference folder is available # get all pref file paths # TOD... | 2.073997 | 2 |
newanalysis/plot_performances.py | nriesterer/cogsci-individualization | 0 | 10396 | import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
if len(sys.argv) != 3:
print('usage: python plot_performances.py <group_csv> <indiv_csv>')
exit()
group_file = sys.argv[1]
indiv_file = sys.argv[2]
# Load the data
df_group = pd.read_csv(group_file)
df_i... | import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
if len(sys.argv) != 3:
print('usage: python plot_performances.py <group_csv> <indiv_csv>')
exit()
group_file = sys.argv[1]
indiv_file = sys.argv[2]
# Load the data
df_group = pd.read_csv(group_file)
df_i... | en | 0.488383 | # Load the data # Prepare the data for plotting # Plot the data | 2.499362 | 2 |
src/helpers.py | demirdagemir/thesis | 0 | 10397 | <filename>src/helpers.py
from Aion.utils.data import getADBPath
import subprocess
def dumpLogCat(apkTarget):
# Aion/shared/DroidutanTest.py
# Define frequently-used commands
# TODO: Refactor adbID
adbID = "192.168.58.101:5555"
adbPath = getADBPath()
dumpLogcatCmd = [adbPath, "-s", adbID, "logc... | <filename>src/helpers.py
from Aion.utils.data import getADBPath
import subprocess
def dumpLogCat(apkTarget):
# Aion/shared/DroidutanTest.py
# Define frequently-used commands
# TODO: Refactor adbID
adbID = "192.168.58.101:5555"
adbPath = getADBPath()
dumpLogcatCmd = [adbPath, "-s", adbID, "logc... | en | 0.749883 | # Aion/shared/DroidutanTest.py # Define frequently-used commands # TODO: Refactor adbID # 5. Dump the system log to file | 2.286941 | 2 |
tests/test_show.py | domi007/pigskin | 6 | 10398 | from collections import OrderedDict
import pytest
import vcr
try: # Python 2.7
# requests's ``json()`` function returns strings as unicode (as per the
# JSON spec). In 2.7, those are of type unicode rather than str. basestring
# was created to help with that.
# https://docs.python.org/2/library/func... | from collections import OrderedDict
import pytest
import vcr
try: # Python 2.7
# requests's ``json()`` function returns strings as unicode (as per the
# JSON spec). In 2.7, those are of type unicode rather than str. basestring
# was created to help with that.
# https://docs.python.org/2/library/func... | en | 0.921252 | # Python 2.7 # requests's ``json()`` function returns strings as unicode (as per the # JSON spec). In 2.7, those are of type unicode rather than str. basestring # was created to help with that. # https://docs.python.org/2/library/functions.html#basestring These don't require authentication to Game Pass. # content is no... | 2.609136 | 3 |
integration_test/basic_op_capi.py | cl9200/nbase-arc | 0 | 10399 | <reponame>cl9200/nbase-arc<gh_stars>0
#
# Copyright 2015 N<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 app... | #
# Copyright 2015 N<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, s... | en | 0.706632 | # # Copyright 2015 N<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, s... | 1.802132 | 2 |