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 |
|---|---|---|---|---|---|---|---|---|---|---|
bomber_monkey/features/tile/tile_killer_system.py | MonkeyPatchIo/bomber-monkey | 0 | 6624051 | <filename>bomber_monkey/features/tile/tile_killer_system.py
from typing import Any, Callable
from bomber_monkey.features.board.board import Tiles
from bomber_monkey.features.physics.rigid_body import RigidBody
from bomber_monkey.features.tile.tile_killer import TileKiller
from python_ecs.ecs import System, Simulator
... | <filename>bomber_monkey/features/tile/tile_killer_system.py
from typing import Any, Callable
from bomber_monkey.features.board.board import Tiles
from bomber_monkey.features.physics.rigid_body import RigidBody
from bomber_monkey.features.tile.tile_killer import TileKiller
from python_ecs.ecs import System, Simulator
... | none | 1 | 2.469701 | 2 | |
userinput/userinput.py | LucaCappelletti94/userinput | 1 | 6624052 | <reponame>LucaCappelletti94/userinput
from typing import Callable, Union, List
import json
import os
from inspect import isfunction
import getpass
from .utils import default_validators, closest, default_sanitizers, clear
def normalize_validators(validator: str) -> List[Callable]:
if validator not in default_valid... | from typing import Callable, Union, List
import json
import os
from inspect import isfunction
import getpass
from .utils import default_validators, closest, default_sanitizers, clear
def normalize_validators(validator: str) -> List[Callable]:
if validator not in default_validators:
candidate = closest(val... | en | 0.659519 | Default handler for uniform user experience. Parameters ---------------------------------------------- name:str, Name of the expected input, used for storing. label:str="Please insert {name}", Label shown to the user. default=None, Default value to use. hidden:bool=False... | 3.050039 | 3 |
nus_tools/types/samurai/content_list.py | arcticdiv/nus_tools | 0 | 6624053 | <reponame>arcticdiv/nus_tools<filename>nus_tools/types/samurai/content_list.py
from typing import List
from . import movie_list, title_list
from .common import SamuraiListBaseType
class SamuraiContentsList(SamuraiListBaseType):
titles: List[title_list.SamuraiListTitle]
movies: List[movie_list.SamuraiListMovi... | from typing import List
from . import movie_list, title_list
from .common import SamuraiListBaseType
class SamuraiContentsList(SamuraiListBaseType):
titles: List[title_list.SamuraiListTitle]
movies: List[movie_list.SamuraiListMovie]
def _read_list(self, xml):
assert xml.tag == 'contents'
... | none | 1 | 2.935668 | 3 | |
examples/absolute-import-rewrite/hello/hello/messages.py | olsonpm/python-vendorize | 38 | 6624054 | <reponame>olsonpm/python-vendorize
message = "hello"
| message = "hello" | none | 1 | 1.060144 | 1 | |
day07/day7_part2.py | raistlin7447/AoC2021 | 0 | 6624055 | <gh_stars>0
import statistics
# Brute Force
with open("day7_input.txt") as f:
crabs = list(map(int, f.readline().strip().split(",")))
best = 2**10000
fuel = lambda distance: int(distance * (distance+1) / 2)
for i in range(min(crabs), max(crabs)+1):
total_fuel = sum(fuel(abs(crab - i)) for crab ... | import statistics
# Brute Force
with open("day7_input.txt") as f:
crabs = list(map(int, f.readline().strip().split(",")))
best = 2**10000
fuel = lambda distance: int(distance * (distance+1) / 2)
for i in range(min(crabs), max(crabs)+1):
total_fuel = sum(fuel(abs(crab - i)) for crab in crabs)
... | en | 0.939525 | # Brute Force # Turns out that mean is usually correct, but can sometimes vary by up to 1/2 # https://www.reddit.com/gallery/rawxad | 3.509853 | 4 |
prototype/back-end/rateapi/migrations/0006_auto_20171119_0100.py | nWo-deHack/CNAP | 0 | 6624056 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-11-18 23:00
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rateapi', '0005_auto_20171110_0404'),
]
operations = [
migr... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-11-18 23:00
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rateapi', '0005_auto_20171110_0404'),
]
operations = [
migr... | en | 0.700517 | # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-11-18 23:00 | 1.617651 | 2 |
agents/loser_agent.py | dbelliss/Starcraft2AI | 2 | 6624057 | <reponame>dbelliss/Starcraft2AI
# https://chatbotslife.com/building-a-basic-pysc2-agent-b109cde1477c
import asyncio
import random
import sc2
from sc2 import Race, Difficulty
from sc2.constants import *
from sc2.player import Bot, Computer
from pprint import pprint
from time import gmtime, strftime, localtime
import o... | # https://chatbotslife.com/building-a-basic-pysc2-agent-b109cde1477c
import asyncio
import random
import sc2
from sc2 import Race, Difficulty
from sc2.constants import *
from sc2.player import Bot, Computer
from pprint import pprint
from time import gmtime, strftime, localtime
import os
# For debugging purposes only... | en | 0.808476 | # https://chatbotslife.com/building-a-basic-pysc2-agent-b109cde1477c # For debugging purposes only # Get strategy enums # For debugging # Setting this to true to write information to log files in the agents/logs directory # Setting this to true causes all logs to be printed to the console # Make logs directory if it do... | 2.442422 | 2 |
gmql/dataset/__init__.py | DEIB-GECO/PyGMQL | 12 | 6624058 | <reponame>DEIB-GECO/PyGMQL<filename>gmql/dataset/__init__.py
from .loaders.Loader import load_from_path
from ..FileManagment import get_resources_dir
import os
def get_example_dataset(name="Example_Dataset_1", load=False):
data_path = os.path.join(get_resources_dir(), "example_datasets", name)
res = load_from... | from .loaders.Loader import load_from_path
from ..FileManagment import get_resources_dir
import os
def get_example_dataset(name="Example_Dataset_1", load=False):
data_path = os.path.join(get_resources_dir(), "example_datasets", name)
res = load_from_path(data_path)
if load:
res = res.materialize()... | none | 1 | 2.146426 | 2 | |
code/archive/config.py | funked1/pieper_md | 0 | 6624059 | import configparser
config = configparser.ConfigParser()
# Database connection credentials
config['database'] = {'host' : 'localhost',
'user' : 'testuser',
'pswd' : 'password',
'data' : 'test',
'charset': 'utf8mb4'}
# Con... | import configparser
config = configparser.ConfigParser()
# Database connection credentials
config['database'] = {'host' : 'localhost',
'user' : 'testuser',
'pswd' : 'password',
'data' : 'test',
'charset': 'utf8mb4'}
# Con... | en | 0.463474 | # Database connection credentials # Configure patient data # Configure sampling parameters # Configure recording channels | 2.269794 | 2 |
src/acconeer/exptool/__init__.py | maxijohansson/acconeer-python-exploration | 0 | 6624060 | __version__ = "3.2.19"
SDK_VERSION = "2.1.0"
| __version__ = "3.2.19"
SDK_VERSION = "2.1.0"
| none | 1 | 1.070774 | 1 | |
P25063-ChenJi/week3.py | magedu-pythons/python-25 | 1 | 6624061 | <filename>P25063-ChenJi/week3.py
#1、给出任意一个列表,请查找出x元素是否在列表里面,如果存在返回1,不存在返回0
lst = ['a', 'b', 'c', 'x', 'd']
def findx():
for ch in lst:
if ch == 'x':
return 1
else:
return 0
print(findx())
# 如果x是一个随机字符呢?代码该怎么修改?
#2、任一个英文的纯文本文件,统计其中的单词出现的个数
import string
word_dict = {}
with open('eng... | <filename>P25063-ChenJi/week3.py
#1、给出任意一个列表,请查找出x元素是否在列表里面,如果存在返回1,不存在返回0
lst = ['a', 'b', 'c', 'x', 'd']
def findx():
for ch in lst:
if ch == 'x':
return 1
else:
return 0
print(findx())
# 如果x是一个随机字符呢?代码该怎么修改?
#2、任一个英文的纯文本文件,统计其中的单词出现的个数
import string
word_dict = {}
with open('eng... | zh | 0.989334 | #1、给出任意一个列表,请查找出x元素是否在列表里面,如果存在返回1,不存在返回0 # 如果x是一个随机字符呢?代码该怎么修改? #2、任一个英文的纯文本文件,统计其中的单词出现的个数 # 只使用空格来分隔字符串,忽略了英文里面以, . ! ? 等各种标点符号结尾的情况。 | 3.918409 | 4 |
examples/makePoly.py | VictorVaquero/geneticPendulum | 0 | 6624062 | """Function allowsInteractively chose polygon vertices, ending when click above line.
Illustrates use of while loops, Text, Line, Polygon, getMouse.
"""
from graphics import *
def isBetween(x, end1, end2):
'''Return True if x is between the ends or equal to either.
The ends do not need to be in increasing ord... | """Function allowsInteractively chose polygon vertices, ending when click above line.
Illustrates use of while loops, Text, Line, Polygon, getMouse.
"""
from graphics import *
def isBetween(x, end1, end2):
'''Return True if x is between the ends or equal to either.
The ends do not need to be in increasing ord... | en | 0.833998 | Function allowsInteractively chose polygon vertices, ending when click above line. Illustrates use of while loops, Text, Line, Polygon, getMouse. Return True if x is between the ends or equal to either. The ends do not need to be in increasing order. Return True if the point is inside the Rectangle rect. Draw a pol... | 4.104315 | 4 |
Python/Model.py | pilarlorente/Energy-expenditure-prediction-wearable-grist | 0 | 6624063 | #!/usr/bin/env python
# coding: utf-8
# In[14]:
##### Import packages
# Basic packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Modelling packages
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.... | #!/usr/bin/env python
# coding: utf-8
# In[14]:
##### Import packages
# Basic packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Modelling packages
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.... | en | 0.829805 | #!/usr/bin/env python # coding: utf-8 # In[14]: ##### Import packages # Basic packages # Modelling packages # To avoid warnings # In[15]: # In[16]: # In[17]: ##### Defining MAPE(Mean Absolute Percentage Error) # In[18]: ##### Columns based on time, change the format # In[19]: #Creating new columns of time # ## Modellin... | 2.780598 | 3 |
rtk/analyses/statistics/Duane.py | rakhimov/rtk | 0 | 6624064 | #!/usr/bin/env python
"""
Contains functions for performing calculations associated with the Duane model.
"""
# -*- coding: utf-8 -*-
#
# rtk.analyses.statistics.Duane.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com
#
# Redistribution ... | #!/usr/bin/env python
"""
Contains functions for performing calculations associated with the Duane model.
"""
# -*- coding: utf-8 -*-
#
# rtk.analyses.statistics.Duane.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com
#
# Redistribution ... | en | 0.696792 | #!/usr/bin/env python Contains functions for performing calculations associated with the Duane model. # -*- coding: utf-8 -*- # # rtk.analyses.statistics.Duane.py is part of The RTK Project # # All rights reserved. # Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com # # Redistribution and use i... | 1.780607 | 2 |
tests/integration/infra/api/devices/http_endpoints/test_hardware_controller.py | mirumon/mirumon-backend | 19 | 6624065 | <gh_stars>10-100
import uuid
import pytest
from fastapi import FastAPI
pytestmark = [pytest.mark.asyncio]
class TestDeviceHardwareV2:
@pytest.fixture
async def response(self, app: FastAPI, client, device_factory):
async with device_factory(device_id=str(uuid.uuid4())) as device:
url = ap... | import uuid
import pytest
from fastapi import FastAPI
pytestmark = [pytest.mark.asyncio]
class TestDeviceHardwareV2:
@pytest.fixture
async def response(self, app: FastAPI, client, device_factory):
async with device_factory(device_id=str(uuid.uuid4())) as device:
url = app.url_path_for("d... | none | 1 | 2.312003 | 2 | |
telegram_bot_sdk/telegram_objects/passportData.py | myOmikron/TelegramBotSDK | 0 | 6624066 | from telegram_bot_sdk.telegram_objects.encryptedCredentials import EncryptedCredentials
from telegram_bot_sdk.telegram_objects.encryptedPassportElement import EncryptedPassportElement
class PassportData:
"""This class contains formation about Telegram Passport data shared with the bot by the user
:param data... | from telegram_bot_sdk.telegram_objects.encryptedCredentials import EncryptedCredentials
from telegram_bot_sdk.telegram_objects.encryptedPassportElement import EncryptedPassportElement
class PassportData:
"""This class contains formation about Telegram Passport data shared with the bot by the user
:param data... | en | 0.856924 | This class contains formation about Telegram Passport data shared with the bot by the user :param data: List with information about documents and other Telegram Passport elements that was shared with the bot :type data: list of :ref:`object_encrypted_passport_element` :param credentials: Encrypted credenti... | 2.56425 | 3 |
students.py | Maurya232Abhishek/Python-repository-for-basics | 2 | 6624067 | students={1:{"name":"Pappu","address":"VNS","marks":{"phy":50,"chem":60}},2:{"name":"Dappu","address":"VNS","marks":{"phy":50,"chem":60}}}
student =students.get(1)
print(student)
address=student.get("address")
print(address)
marks=student.get("marks")
print(marks)
phy = marks.get("phy")
print(phy) | students={1:{"name":"Pappu","address":"VNS","marks":{"phy":50,"chem":60}},2:{"name":"Dappu","address":"VNS","marks":{"phy":50,"chem":60}}}
student =students.get(1)
print(student)
address=student.get("address")
print(address)
marks=student.get("marks")
print(marks)
phy = marks.get("phy")
print(phy) | none | 1 | 3.622695 | 4 | |
arekit/contrib/experiment_rusentrel/exp_ds/utils.py | nicolay-r/AREk | 18 | 6624068 | <reponame>nicolay-r/AREk<filename>arekit/contrib/experiment_rusentrel/exp_ds/utils.py
import logging
from arekit.common.utils import progress_bar_iter
from arekit.contrib.experiment_rusentrel.labels.scalers.ruattitudes import ExperimentRuAttitudesLabelConverter
from arekit.contrib.source.ruattitudes.collection import ... | import logging
from arekit.common.utils import progress_bar_iter
from arekit.contrib.experiment_rusentrel.labels.scalers.ruattitudes import ExperimentRuAttitudesLabelConverter
from arekit.contrib.source.ruattitudes.collection import RuAttitudesCollection
from arekit.contrib.source.ruattitudes.io_utils import RuAttitud... | en | 0.842655 | Performs reading of ruattitude formatted documents and selection according to 'doc_ids_set' parameter. used_doc_ids_set: set or None ids of documents that already used and could not be assigned 'None' corresponds to an empty set. | 2.046114 | 2 |
app.py | jaquielajoie/BS-Financial-Analytics | 1 | 6624069 | <filename>app.py<gh_stars>1-10
from flask import Flask, render_template
import sqlite3
import ast
db = "twit_data.db"
app = Flask(__name__)
def get_top_tweets():
conn = sqlite3.connect(db)
conn.row_factory = sqlite3.Row
c = conn.cursor()
c.execute("SELECT * from twit_data ORDER BY datetime DESC LIM... | <filename>app.py<gh_stars>1-10
from flask import Flask, render_template
import sqlite3
import ast
db = "twit_data.db"
app = Flask(__name__)
def get_top_tweets():
conn = sqlite3.connect(db)
conn.row_factory = sqlite3.Row
c = conn.cursor()
c.execute("SELECT * from twit_data ORDER BY datetime DESC LIM... | none | 1 | 2.771162 | 3 | |
scripts/retired/data_prep_lit_to_dict.py | tcrundall/chronostar | 0 | 6624070 | <filename>scripts/retired/data_prep_lit_to_dict.py<gh_stars>0
"""
Take (excerpt of) the lit compiled RV table and convert into standardised
format and
"""
from __future__ import print_function, division
from astropy.table import Table
import csv
import numpy as np
import sys
sys.path.insert(0, '..')
import chronosta... | <filename>scripts/retired/data_prep_lit_to_dict.py<gh_stars>0
"""
Take (excerpt of) the lit compiled RV table and convert into standardised
format and
"""
from __future__ import print_function, division
from astropy.table import Table
import csv
import numpy as np
import sys
sys.path.insert(0, '..')
import chronosta... | en | 0.292904 | Take (excerpt of) the lit compiled RV table and convert into standardised format and #original_tb_file = "../data/bp_TGAS2_traceback_save.pkl" #astro_file = "../data/bp_astro.dat" # this column is start of the gaia contiguous data block # this column is start of the gaia contiguous data block # data_ordered = np.vstack... | 2.62853 | 3 |
example_service/core/services/CalculationService.py | artemijan/python-api | 0 | 6624071 | <filename>example_service/core/services/CalculationService.py
class Operator:
PLUS = '+'
MINUS = '+'
MUL = '*'
DIV = '/'
choices = (
(PLUS, '+'),
(MINUS, '-'),
(MUL, '*'),
(DIV, '/'),
)
# Should be model
class CalculationTask:
def __init__(self, arg1: float... | <filename>example_service/core/services/CalculationService.py
class Operator:
PLUS = '+'
MINUS = '+'
MUL = '*'
DIV = '/'
choices = (
(PLUS, '+'),
(MINUS, '-'),
(MUL, '*'),
(DIV, '/'),
)
# Should be model
class CalculationTask:
def __init__(self, arg1: float... | en | 0.68927 | # Should be model # Should be model | 2.722779 | 3 |
src/terminal/env_sensor_log2.py | informatiquecsud/m5-stack-utils-core | 0 | 6624072 | from m5stack import *
import time
import unit
from terminal import Terminal
env0 = unit.get(unit.ENV, unit.PORTA)
t = Terminal()
while True:
if btnA.wasPressed():
break
pressure = env0.pressure
temperature = env0.temperature
humidity = env0.humidity
t.print("P={pressure}, T={temperature}... | from m5stack import *
import time
import unit
from terminal import Terminal
env0 = unit.get(unit.ENV, unit.PORTA)
t = Terminal()
while True:
if btnA.wasPressed():
break
pressure = env0.pressure
temperature = env0.temperature
humidity = env0.humidity
t.print("P={pressure}, T={temperature}... | none | 1 | 2.614364 | 3 | |
coding/test_info.py | CrashingBrain/BSc_Project | 0 | 6624073 | <filename>coding/test_info.py
import bhvs as bv
import info as inf
import numpy as np
import prob as pr
import time
import matplotlib.pyplot as plt
# Test conditiona MutInf
if False:
P = bv.FourPDstrb()
print("Test CondMutInfo")
start = time.time()
print(inf.condMutInf(pr.marginal(P,3)))
end = ... | <filename>coding/test_info.py
import bhvs as bv
import info as inf
import numpy as np
import prob as pr
import time
import matplotlib.pyplot as plt
# Test conditiona MutInf
if False:
P = bv.FourPDstrb()
print("Test CondMutInfo")
start = time.time()
print(inf.condMutInf(pr.marginal(P,3)))
end = ... | en | 0.781348 | # Test conditiona MutInf # Test channels # Test deterministic channels # Check the reduced intrinsic information upper bound # Compute the intrinsic information I(X;Y\d UZ) # Compute the intrinsic information I(X;Y\d UZ) # Replace the channel by one that goes to joint variable # Alternatively: join the parties ZU to a ... | 1.991136 | 2 |
prediction_lib/prediction_test.py | rhaertel80/model_server | 2 | 6624074 | <reponame>rhaertel80/model_server
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | en | 0.674856 | # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a... | 2.013642 | 2 |
internal/handlers/qatar.py | fillingthemoon/cartogram-web | 0 | 6624075 | <reponame>fillingthemoon/cartogram-web
import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Qatar"
def get_gen_file(self):
return "{}/qat_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
... | import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Qatar"
def get_gen_file(self):
return "{}/qat_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
def validate_values(self, value... | en | 0.297982 | 1 {} Al Daayen 2 {} Al Khor 3 {} Al Rayyan 4 {} Al Shamal 5 {} Al Wakrah 6 {} Al-Shahaniya 7 {} Doha 8 {} Umm Salal | 2.703695 | 3 |
students/K33421/Golub_Anna/LR_1/task 2/client.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 7 | 6624076 | import socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("127.0.0.1", 9000))
# sending message to server
a = input('Верхнее основание трапеции: ')
b = input('Нижнее основание трапеции: ')
h = input('Высота трапеции: ')
message = ' '.join([str(a), str(b), str(h)]).encode()
conn.send(message... | import socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("127.0.0.1", 9000))
# sending message to server
a = input('Верхнее основание трапеции: ')
b = input('Нижнее основание трапеции: ')
h = input('Высота трапеции: ')
message = ' '.join([str(a), str(b), str(h)]).encode()
conn.send(message... | en | 0.869646 | # sending message to server # receiving server's response | 3.111938 | 3 |
driver/mimasdriver/__init__.py | Jojojoppe/MimasV1Firmware | 0 | 6624077 | <filename>driver/mimasdriver/__init__.py
from .mimas_interface import MimasInterface | <filename>driver/mimasdriver/__init__.py
from .mimas_interface import MimasInterface | none | 1 | 1.145871 | 1 | |
tests/test-default.py | oyebode23/govexec-sample | 0 | 6624078 | import sys
def main():
sys.stdout.write("Hello World")
if __name__=="__main__":
main()
| import sys
def main():
sys.stdout.write("Hello World")
if __name__=="__main__":
main()
| none | 1 | 2.101519 | 2 | |
examples/setuptools-test_suite/setup.py | andreztz/SomePackage | 1 | 6624079 | from setuptools import setup
setup(
name='A_Package',
packages=['a_package'],
test_suite='a_package.load_suite'
)
| from setuptools import setup
setup(
name='A_Package',
packages=['a_package'],
test_suite='a_package.load_suite'
)
| none | 1 | 1.231544 | 1 | |
src/notelist/views/authentication.py | jajimenez/notelist | 1 | 6624080 | <filename>src/notelist/views/authentication.py
"""Authentication views module."""
from hmac import compare_digest
from datetime import timedelta
from flask import Blueprint, request
from flask_jwt_extended import (
jwt_required, create_access_token, create_refresh_token, get_jwt,
get_jwt_identity
)
from note... | <filename>src/notelist/views/authentication.py
"""Authentication views module."""
from hmac import compare_digest
from datetime import timedelta
from flask import Blueprint, request
from flask_jwt_extended import (
jwt_required, create_access_token, create_refresh_token, get_jwt,
get_jwt_identity
)
from note... | en | 0.725459 | Authentication views module. # Messages # Blueprint object # Schema Log in. This operation returns a fresh access token and a refresh token. Any of the tokens can be provided to an API request in the following header: "Authorization: Bearer access_token" Request data (JSON string): - usern... | 2.666074 | 3 |
trading_alert/base/line_drawer.py | culdo/trading_alert | 0 | 6624081 | <reponame>culdo/trading_alert<gh_stars>0
import time
import tkinter
import numpy as np
from trading_alert.base.single_line import SingleLine
class LineDrawer:
def __init__(self, pp):
self.is_move_done = False
self.lines = []
self.fig = pp.fig
self.ax = pp.ax1
self.pp = p... | import time
import tkinter
import numpy as np
from trading_alert.base.single_line import SingleLine
class LineDrawer:
def __init__(self, pp):
self.is_move_done = False
self.lines = []
self.fig = pp.fig
self.ax = pp.ax1
self.pp = pp
self._min_d = None
self... | none | 1 | 2.631869 | 3 | |
tools/c7n_openstack/c7n_openstack/client.py | al3pht/cloud-custodian | 2,415 | 6624082 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | en | 0.82087 | # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 # Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License... | 2.10994 | 2 |
backend/src/myCU_App/migrations/0002_auto_20200309_0348.py | citz73/myCUProject | 1 | 6624083 | # Generated by Django 2.2.7 on 2020-03-09 03:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myCU_App', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', m... | # Generated by Django 2.2.7 on 2020-03-09 03:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myCU_App', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', m... | en | 0.699448 | # Generated by Django 2.2.7 on 2020-03-09 03:48 | 1.855632 | 2 |
viz.py | varshiths/rmod-snn | 1 | 6624084 |
import sys
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set()
def smooth(x,window_len=100,window='hanning'):
s=np.r_[x[window_len-1:0:-1],x,x[-1:-window_len:-1]]
if window == 'flat': #moving average
w=np.ones(window_len,'d')
else:
w=eval('np.'+window+'(wi... |
import sys
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set()
def smooth(x,window_len=100,window='hanning'):
s=np.r_[x[window_len-1:0:-1],x,x[-1:-window_len:-1]]
if window == 'flat': #moving average
w=np.ones(window_len,'d')
else:
w=eval('np.'+window+'(wi... | en | 0.135236 | #moving average # xlimits=1e7 # ylimits=2000 # axes.set_xlim([0,xlimits]) | 3.045737 | 3 |
plot_support_jgm.py | JAGalvis/useful_code | 0 | 6624085 | def plot_categorical_bars(df, column, hue=None, colors = None, normalized = True, figsize=(10,4), display_val = True):
'''
Creates a column plot of categorical data using seaborn
'''
norm = len(df) if normalized else 1
y = 'percent' if normalized else 'count_values'
columns = [col for col in... | def plot_categorical_bars(df, column, hue=None, colors = None, normalized = True, figsize=(10,4), display_val = True):
'''
Creates a column plot of categorical data using seaborn
'''
norm = len(df) if normalized else 1
y = 'percent' if normalized else 'count_values'
columns = [col for col in... | en | 0.628154 | Creates a column plot of categorical data using seaborn Plots faceted bar chart Plots the distribution of unique values in the integer columns. Plots distribution of all float columns https://www.kaggle.com/willkoehrsen/a-complete-introduction-and-walkthrough # Color mapping #{1: 'red', 2: 'orange', 3: 'blue', ... | 3.274566 | 3 |
landmapper/urls.py | Ecotrust/woodland-discovery | 1 | 6624086 | <gh_stars>1-10
from django.conf.urls import url, include
from rpc4django.views import serve_rpc_request
from . import views
from .models import AOI
from features.views import form_resources
urlpatterns = [
url(r'^rpc$', serve_rpc_request, name='rpc'),
url(r'^about/', views.about, name='about'),
url(r'^help... | from django.conf.urls import url, include
from rpc4django.views import serve_rpc_request
from . import views
from .models import AOI
from features.views import form_resources
urlpatterns = [
url(r'^rpc$', serve_rpc_request, name='rpc'),
url(r'^about/', views.about, name='about'),
url(r'^help/', views.help,... | en | 0.49316 | # TODO fix urls so account and visualize static text can be overwritten # url(r"^visualize/", include("visualize.urls")), | 2.046643 | 2 |
research/cv/3dcnn/src/loss.py | leelige/mindspore | 77 | 6624087 | <filename>research/cv/3dcnn/src/loss.py<gh_stars>10-100
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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/LICENS... | <filename>research/cv/3dcnn/src/loss.py<gh_stars>10-100
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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/LICENS... | en | 0.799096 | # Copyright 2021 Huawei Technologies Co., Ltd # # 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... | 2.182154 | 2 |
boucanpy/db/migrate/history.py | bbhunter/boucanpy | 34 | 6624088 | from boucanpy.db.migrate.config import get_config
# late import of alembic because it destroys loggers
def history(directory=None, rev_range=None, verbose=False, indicate_current=False):
from alembic import command
"""List changeset scripts in chronological order."""
config = get_config(directory)
com... | from boucanpy.db.migrate.config import get_config
# late import of alembic because it destroys loggers
def history(directory=None, rev_range=None, verbose=False, indicate_current=False):
from alembic import command
"""List changeset scripts in chronological order."""
config = get_config(directory)
com... | en | 0.711118 | # late import of alembic because it destroys loggers List changeset scripts in chronological order. | 2.098748 | 2 |
tests/strats.py | Tinche/flattrs | 7 | 6624089 | from struct import pack, unpack
from hypothesis.strategies import composite, integers, floats
uint8s = integers(0, 2 ** 8 - 1)
uint16s = integers(0, 2 ** 16 - 1)
uint32s = integers(0, 2 ** 32 - 1)
uint64s = integers(0, 2 ** 64 - 1)
int8s = integers(-(2 ** 7), (2 ** 7) - 1)
int16s = integers(-(2 ** 15), (2 ** 15) - 1... | from struct import pack, unpack
from hypothesis.strategies import composite, integers, floats
uint8s = integers(0, 2 ** 8 - 1)
uint16s = integers(0, 2 ** 16 - 1)
uint32s = integers(0, 2 ** 32 - 1)
uint64s = integers(0, 2 ** 64 - 1)
int8s = integers(-(2 ** 7), (2 ** 7) - 1)
int16s = integers(-(2 ** 15), (2 ** 15) - 1... | none | 1 | 2.477077 | 2 | |
fsl-feat/interfaces.py | oesteban/misc | 2 | 6624090 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import nibabel as nb
import pandas as pd
from scipy.spatial.distance import pdist, squareform
from scipy.stats import pearsonr
from nipype import logging
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, SimpleInterf... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import nibabel as nb
import pandas as pd
from scipy.spatial.distance import pdist, squareform
from scipy.stats import pearsonr
from nipype import logging
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, SimpleInterf... | en | 0.71084 | #!/usr/bin/env python # -*- coding: utf-8 -*- A replacement for nipype.interfaces.ants.resampling.ApplyTransforms that fixes the resampled image header to match the xform of the reference image # Run normally Adapt a BIDS-compliant events file to a format compatible with FSL feat Args: dataframe: ev... | 2.069535 | 2 |
{{cookiecutter.repo_name}}/config/settings.py | st4lk/cookiecutter-django | 2 | 6624091 | <filename>{{cookiecutter.repo_name}}/config/settings.py
"""
Django settings for {{cookiecutter.project_name}} project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"... | <filename>{{cookiecutter.repo_name}}/config/settings.py
"""
Django settings for {{cookiecutter.project_name}} project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"... | en | 0.606041 | Django settings for {{cookiecutter.project_name}} project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ # Build paths inside the project like this: os.path.join(BASE... | 1.742388 | 2 |
classes/EMail.py | ZikyHD/Sigma2SplunkAlert | 85 | 6624092 | <gh_stars>10-100
class EMail:
def __init__(self, email_config, sigma_uc):
# mandatory values
self.to = email_config["to"]
self.subject = email_config["subject"]
self.message = email_config["message"]
# optional values
if "result_link" in email_config:
se... | class EMail:
def __init__(self, email_config, sigma_uc):
# mandatory values
self.to = email_config["to"]
self.subject = email_config["subject"]
self.message = email_config["message"]
# optional values
if "result_link" in email_config:
self.result_link = ... | en | 0.453474 | # mandatory values # optional values # Generate text block based on fields value in Sigma Use Case # Generate tag block based on tags in Sigma Use Case | 2.401919 | 2 |
apphub/meta_learning/MAML/maml.py | rajesh1226/fastestimator | 1 | 6624093 | # Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | en | 0.807271 | # Copyright 2019 The FastEstimator Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl... | 2.03527 | 2 |
bouncer/authentication/models.py | sourcelair/bouncer-api | 0 | 6624094 | <reponame>sourcelair/bouncer-api
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.crypto import get_random_string
def generate_key():
return get_random_string(length=32)
class AuthToken(models.Model):
key = models.CharFie... | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.crypto import get_random_string
def generate_key():
return get_random_string(length=32)
class AuthToken(models.Model):
key = models.CharField(
max_length=32, defaul... | none | 1 | 2.110045 | 2 | |
examples/stack_examples.py | jtmorrell/curie | 1 | 6624095 | import curie as ci
import numpy as np
def basic_examples():
el = ci.Element('Fe')
print(el.S(20.0))
print(el.S(20.0, particle='a'))
el.plot_S()
stack = stack=[{'compound':'Ni', 'name':'Ni01', 'thickness':0.025}, # Thickness only (mm)
{'compound':'Kapton', 'thickness':0.05}, # No name - will not be talli... | import curie as ci
import numpy as np
def basic_examples():
el = ci.Element('Fe')
print(el.S(20.0))
print(el.S(20.0, particle='a'))
el.plot_S()
stack = stack=[{'compound':'Ni', 'name':'Ni01', 'thickness':0.025}, # Thickness only (mm)
{'compound':'Kapton', 'thickness':0.05}, # No name - will not be talli... | en | 0.7131 | # Thickness only (mm) # No name - will not be tallied # Very thick: should see straggle ### Import stack design from .csv file ### S in MeV/(mg/cm^2) # preset compound for 316 Stainless ### S in MeV/(mg/cm^2) | 2.709723 | 3 |
migrations/versions/4ea72a17a3f_.py | anniejw6/numb3rs_randomizer | 0 | 6624096 | <reponame>anniejw6/numb3rs_randomizer
"""empty message
Revision ID: 4<PASSWORD>
Revises: None
Create Date: 2015-07-05 12:43:37.912793
"""
# revision identifiers, used by Alembic.
revision = '4<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gener... | """empty message
Revision ID: 4<PASSWORD>
Revises: None
Create Date: 2015-07-05 12:43:37.912793
"""
# revision identifiers, used by Alembic.
revision = '4<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
... | en | 0.495954 | empty message Revision ID: 4<PASSWORD> Revises: None Create Date: 2015-07-05 12:43:37.912793 # revision identifiers, used by Alembic. ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### | 1.25928 | 1 |
npstreams/tests/test_flow.py | LaurentRDC/npstreams | 30 | 6624097 | <filename>npstreams/tests/test_flow.py
# -*- coding: utf-8 -*-
import numpy as np
from pathlib import Path
from npstreams import array_stream, ipipe, last, iload, pload, isum
@array_stream
def iden(arrays):
yield from arrays
def test_ipipe_order():
"""Test that ipipe(f, g, h, arrays) -> f(g(h(arr))) for ar... | <filename>npstreams/tests/test_flow.py
# -*- coding: utf-8 -*-
import numpy as np
from pathlib import Path
from npstreams import array_stream, ipipe, last, iload, pload, isum
@array_stream
def iden(arrays):
yield from arrays
def test_ipipe_order():
"""Test that ipipe(f, g, h, arrays) -> f(g(h(arr))) for ar... | en | 0.719061 | # -*- coding: utf-8 -*- Test that ipipe(f, g, h, arrays) -> f(g(h(arr))) for arr in arrays Test that ipipe(f, g, h, arrays) -> f(g(h(arr))) for arr in arrays Test that iload works on glob-like patterns # Cast to float for np.allclose Test that iload works on iterable of filenames # Cast to float for np.allclose Test th... | 2.579848 | 3 |
colour/examples/recovery/examples_smits1999.py | BPearlstine/colour | 2 | 6624098 | # -*- coding: utf-8 -*-
"""
Showcases reflectance recovery computations using *Smits (1999)* method.
"""
import numpy as np
import colour
from colour.recovery.smits1999 import XYZ_to_RGB_Smits1999
from colour.utilities import message_box
message_box('"Smits (1999)" - Reflectance Recovery Computations')
XYZ = np.arr... | # -*- coding: utf-8 -*-
"""
Showcases reflectance recovery computations using *Smits (1999)* method.
"""
import numpy as np
import colour
from colour.recovery.smits1999 import XYZ_to_RGB_Smits1999
from colour.utilities import message_box
message_box('"Smits (1999)" - Reflectance Recovery Computations')
XYZ = np.arr... | en | 0.578172 | # -*- coding: utf-8 -*- Showcases reflectance recovery computations using *Smits (1999)* method. | 2.993708 | 3 |
experiment.py | adammoss/vae | 0 | 6624099 | <gh_stars>0
import math
import torch
from torch import optim
from models import BaseVAE
from models.types_ import *
import pytorch_lightning as pl
from torchvision import transforms
import torchvision.utils as vutils
from torchvision.datasets import CelebA, MNIST, CIFAR10
from astrovision.datasets import LensChallengeS... | import math
import torch
from torch import optim
from models import BaseVAE
from models.types_ import *
import pytorch_lightning as pl
from torchvision import transforms
import torchvision.utils as vutils
from torchvision.datasets import CelebA, MNIST, CIFAR10
from astrovision.datasets import LensChallengeSpace1
from t... | en | 0.861106 | # Check if more than 1 optimizer is required (Used for adversarial training) # Check if another scheduler is required for the second optimizer | 2.112276 | 2 |
pinax/messages/api/serializers.py | thetruefuss/theoctopuslibrary | 4 | 6624100 | <reponame>thetruefuss/theoctopuslibrary<filename>pinax/messages/api/serializers.py
from accounts.api.serializers import UserPublicSerializer
from pinax.messages.models import Message, Thread
from rest_framework import serializers
class ThreadListSerializer(serializers.ModelSerializer):
url = serializers.Hyperlink... | from accounts.api.serializers import UserPublicSerializer
from pinax.messages.models import Message, Thread
from rest_framework import serializers
class ThreadListSerializer(serializers.ModelSerializer):
url = serializers.HyperlinkedIdentityField(
view_name='messages-api:thread_retrieve',
lookup_f... | none | 1 | 2.103594 | 2 | |
higlass_schema/utils.py | higlass/higlass-schema | 1 | 6624101 | <gh_stars>1-10
from typing import Any, Dict, TypeVar
from pydantic import BaseModel, schema_of
def simplify_schema(root_schema: Dict[str, Any]) -> Dict[str, Any]:
"""Lift defintion reference to root if only definition"""
# type of root is not a reference to a definition
if not "$ref" in root_schema:
... | from typing import Any, Dict, TypeVar
from pydantic import BaseModel, schema_of
def simplify_schema(root_schema: Dict[str, Any]) -> Dict[str, Any]:
"""Lift defintion reference to root if only definition"""
# type of root is not a reference to a definition
if not "$ref" in root_schema:
return root... | en | 0.720761 | Lift defintion reference to root if only definition # type of root is not a reference to a definition ## Schema modifiers Remove automatically generated tiles for pydantic classes. # remove autogenerated title # reduce union of enums into single enum # if there is only one enum entry, make it a const | 2.703411 | 3 |
BEGIN/DAY_03/001.flow-if-else-conditional.py | thakopian/100-DAYS-OF-PYTHON-PROJECT | 0 | 6624102 | <filename>BEGIN/DAY_03/001.flow-if-else-conditional.py
print("Can you the rollercoaster!?")
height = int(input("What is your height in cm? "))
'''
#pseudo code
if condition:
do this
else:
do this
'''
if height >= 125:
print("Get on board and ridet he rollercoaster!!!")
else:
print("sorry not good en... | <filename>BEGIN/DAY_03/001.flow-if-else-conditional.py
print("Can you the rollercoaster!?")
height = int(input("What is your height in cm? "))
'''
#pseudo code
if condition:
do this
else:
do this
'''
if height >= 125:
print("Get on board and ridet he rollercoaster!!!")
else:
print("sorry not good en... | en | 0.418989 | #pseudo code if condition: do this else: do this | 4.246231 | 4 |
src/mcare_backend/patients/urls.py | BuildForSDG/Team-108-Backend | 0 | 6624103 | <gh_stars>0
from django.urls import path, include
from rest_framework import routers
from patients.views import (
PatientGroupViewSet,
MessagesViewSet
)
router = routers.DefaultRouter()
router.register(r'groups', PatientGroupViewSet)
router.register(r'messages', MessagesViewSet)
urlpatterns = [
path('',... | from django.urls import path, include
from rest_framework import routers
from patients.views import (
PatientGroupViewSet,
MessagesViewSet
)
router = routers.DefaultRouter()
router.register(r'groups', PatientGroupViewSet)
router.register(r'messages', MessagesViewSet)
urlpatterns = [
path('', include(rou... | none | 1 | 1.751749 | 2 | |
preprocessing/data_normalize.py | xxcheng0708/AudioEmbeddingExtraction | 1 | 6624104 | # coding:utf-8
"""
Created by <NAME> at 2022/1/16 20:10
@email : <EMAIL>
"""
import torch
def get_dataset_mean_and_std(dataset, batch_size):
"""
计算数据集的均值和方差,用来做归一化
:param dataset:
:param batch_size:
:return:
"""
dataloader = torch.utils.data.DataLoader(dataset, batch_size=batch_siz... | # coding:utf-8
"""
Created by <NAME> at 2022/1/16 20:10
@email : <EMAIL>
"""
import torch
def get_dataset_mean_and_std(dataset, batch_size):
"""
计算数据集的均值和方差,用来做归一化
:param dataset:
:param batch_size:
:return:
"""
dataloader = torch.utils.data.DataLoader(dataset, batch_size=batch_siz... | en | 0.372041 | # coding:utf-8 Created by <NAME> at 2022/1/16 20:10 @email : <EMAIL> 计算数据集的均值和方差,用来做归一化 :param dataset: :param batch_size: :return: # 音频特征数据是1通道的,所以这里是1 | 2.634179 | 3 |
aws/amazonia/amazonia/classes/hosted_zone.py | linz/Geodesy-Web-Services | 2 | 6624105 | <gh_stars>1-10
#!/usr/bin/python3
from troposphere import route53, Ref, Join
from troposphere.route53 import HostedZoneVPCs
class HostedZone(object):
def __init__(self, template, domain, vpcs):
"""
Creates a troposphere HostedZoneVPC object from a troposphere vpc object.
AWS: https://docs... | #!/usr/bin/python3
from troposphere import route53, Ref, Join
from troposphere.route53 import HostedZoneVPCs
class HostedZone(object):
def __init__(self, template, domain, vpcs):
"""
Creates a troposphere HostedZoneVPC object from a troposphere vpc object.
AWS: https://docs.aws.amazon.com... | en | 0.793054 | #!/usr/bin/python3 Creates a troposphere HostedZoneVPC object from a troposphere vpc object. AWS: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html Troposphere: https://github.com/cloudtools/troposphere/blob/master/troposphere/route53.py :param t... | 2.830776 | 3 |
mininet/mininet/wifi.py | gustavo978/helpful | 0 | 6624106 | <filename>mininet/mininet/wifi.py
import socket
from time import sleep
import mininet.node
import mininet.link
from mininet.log import info
from mininet.util import moveIntf
from mininet.cluster.link import RemoteLink
class WIFI (object):
def __init__ (self, enableQos=True, rootSwitch=None, agentIP=None, agentPor... | <filename>mininet/mininet/wifi.py
import socket
from time import sleep
import mininet.node
import mininet.link
from mininet.log import info
from mininet.util import moveIntf
from mininet.cluster.link import RemoteLink
class WIFI (object):
def __init__ (self, enableQos=True, rootSwitch=None, agentIP=None, agentPor... | en | 0.964399 | TapBridgeIntf is a Linux TAP interface, which is bridged with an NS-3 NetDevice. | 2.210024 | 2 |
feasability_study/con_utils.py | totonga/wodson | 1 | 6624107 | #!/usr/bin/env python
"""
Access ASAM Ods python using omniorb and wrap it using swagger.
Copyright (c) 2015, <NAME>
License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)
"""
__author__ = "<NAME>"
__license__ = "Apache 2.0"
__version__ = "0.0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__statu... | #!/usr/bin/env python
"""
Access ASAM Ods python using omniorb and wrap it using swagger.
Copyright (c) 2015, <NAME>
License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)
"""
__author__ = "<NAME>"
__license__ = "Apache 2.0"
__version__ = "0.0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__statu... | en | 0.431107 | #!/usr/bin/env python Access ASAM Ods python using omniorb and wrap it using swagger. Copyright (c) 2015, <NAME> License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) | 2.273715 | 2 |
pyowb/tasks.py | fifoforlifo/pyowb | 0 | 6624108 | import sys
import xml.sax.saxutils
from .keywords import *
def xml_escape_attr(string):
return xml.sax.saxutils.quoteattr(string)
def xml_escape_elem(string):
return xml.sax.saxutils.escape(string)
_global_auto_id = 100
def _next_global_auto_id():
global _global_auto_id
auto_id = '_auto' + str(_globa... | import sys
import xml.sax.saxutils
from .keywords import *
def xml_escape_attr(string):
return xml.sax.saxutils.quoteattr(string)
def xml_escape_elem(string):
return xml.sax.saxutils.escape(string)
_global_auto_id = 100
def _next_global_auto_id():
global _global_auto_id
auto_id = '_auto' + str(_globa... | none | 1 | 2.45612 | 2 | |
useful-scripts/seg2mesh.py | hci-unihd/plant-seg-tools | 0 | 6624109 | import argparse
import glob
import os
import time
from datetime import datetime
import numpy as np
from plantsegtools.meshes.meshes import seg2mesh, seg2mesh_ray
from plantsegtools.meshes.vtkutils import CreateMeshVTK, create_ply
from plantsegtools.utils import TIFF_FORMATS, H5_FORMATS, get_largest_object
def parse... | import argparse
import glob
import os
import time
from datetime import datetime
import numpy as np
from plantsegtools.meshes.meshes import seg2mesh, seg2mesh_ray
from plantsegtools.meshes.vtkutils import CreateMeshVTK, create_ply
from plantsegtools.utils import TIFF_FORMATS, H5_FORMATS, get_largest_object
def parse... | en | 0.613348 | # Required # Optional - path setup # Optional - pipeline parameters # Optional - mesh processing parameters # Optional - multiprocessing # Setup path # Optional - path setups # Optional - pipeline parameters # Optional - multiprocessing # Setup mesh specific utils # Seg2mesh mesh backend is completely independent optio... | 2.447163 | 2 |
cookdemo/urls.py | ChenJnHui/git_demo | 0 | 6624110 | <filename>cookdemo/urls.py
from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^setcook/$', views.setcookfunc),
re_path(r'^getcook/$', views.getcookfunc),
] | <filename>cookdemo/urls.py
from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^setcook/$', views.setcookfunc),
re_path(r'^getcook/$', views.getcookfunc),
] | none | 1 | 1.610374 | 2 | |
Projects/CS_VQE/old_scripts/myriad_script_NEW_implementation.py | AlexisRalli/VQE-code | 1 | 6624111 | <reponame>AlexisRalli/VQE-code<filename>Projects/CS_VQE/old_scripts/myriad_script_NEW_implementation.py
import numpy as np
import cs_vqe as c
from copy import deepcopy as copy
from tqdm import tqdm
import pickle
import datetime
import quchem.Misc_functions.conversion_scripts as conv_scr
import cs_vqe_with_LCU as c_LCU... | import numpy as np
import cs_vqe as c
from copy import deepcopy as copy
from tqdm import tqdm
import pickle
import datetime
import quchem.Misc_functions.conversion_scripts as conv_scr
import cs_vqe_with_LCU as c_LCU
import ast
import matplotlib.pyplot as plt
import os
# working_dir = os.getcwd()
working_dir = os.pa... | en | 0.23116 | # working_dir = os.getcwd() # gets directory where running python file is! ##### OLD WAY #### ####### SAVE OUTPUT details ######## ####### SAVE OUTPUT ##### NEW IMPLEMENTATION #### ### <--- change for paper! ####### SAVE OUTPUT | 2.065171 | 2 |
drf_handlers/__version__.py | thomas545/drf-errors-formatter | 1 | 6624112 | <filename>drf_handlers/__version__.py
__title__ = 'drf-errors-formatter'
__description__ = 'Format errors in Django Rest Framework.'
__url__ = 'https://github.com/thomas545/drf-errors-formatter'
__version__ = '1.0.1'
__author__ = '@thomas545 https://github.com/thomas545'
__author_email__ = '<EMAIL>'
__license__ = 'MIT'... | <filename>drf_handlers/__version__.py
__title__ = 'drf-errors-formatter'
__description__ = 'Format errors in Django Rest Framework.'
__url__ = 'https://github.com/thomas545/drf-errors-formatter'
__version__ = '1.0.1'
__author__ = '@thomas545 https://github.com/thomas545'
__author_email__ = '<EMAIL>'
__license__ = 'MIT'... | none | 1 | 1.50477 | 2 | |
tests/04_parser/test_parser.py | krystophny/pytchfort | 6 | 6624113 | import os
import pytest
from shutil import copy
from fffi import FortranModule
dtypes = ['logical', 'integer', 'real', 'complex']
@pytest.fixture(scope='module')
def cwd():
return os.path.dirname(__file__)
@pytest.fixture
def fort_mod(tmp_path, cwd):
copy(os.path.join(cwd, 'test_parser.f90'), tmp_path)
... | import os
import pytest
from shutil import copy
from fffi import FortranModule
dtypes = ['logical', 'integer', 'real', 'complex']
@pytest.fixture(scope='module')
def cwd():
return os.path.dirname(__file__)
@pytest.fixture
def fort_mod(tmp_path, cwd):
copy(os.path.join(cwd, 'test_parser.f90'), tmp_path)
... | en | 0.473279 | \ module mod_test contains subroutine test(x) real :: x x = 1. end subroutine test subroutine test2(x) real :: x x = 1. end subroutine subroutine test3(x) real :: x x = 1. end s... | 1.974597 | 2 |
monitor/cube.py | UWCubeSat/bairing | 0 | 6624114 | <reponame>UWCubeSat/bairing<gh_stars>0
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
vertices = (
(1, -1, -1),
(1, 1, -1),
(-1, 1, -1),
(-1, -1, -1),
(1, -1, 1),
(1, 1, 1),
(-1, -1, 1),
(-1, 1, 1),
(0, 0, 1),
(0, 0, 2)
)
edges = (
(0... | import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
vertices = (
(1, -1, -1),
(1, 1, -1),
(-1, 1, -1),
(-1, -1, -1),
(1, -1, 1),
(1, 1, 1),
(-1, -1, 1),
(-1, 1, 1),
(0, 0, 1),
(0, 0, 2)
)
edges = (
(0,1),
(0,3),
(0,4),
(2,1),
(2,3)... | none | 1 | 2.832299 | 3 | |
GR_BASS/launchBASS.py | oliviermirat/BASS | 1 | 6624115 | import sys
sys.path.insert(1, './BASS_only_original/')
import bass as md
import numpy as np
import os
import pickle
def getPosteriorProbabilities(data_explo_hmm, lengths_explo_hmm, model_fit):
lengths_explo = lengths_explo_hmm[:]
data_explo = data_explo_hmm[:np.sum(lengths_explo)]
Hexplo = -model_fit.score(dat... | import sys
sys.path.insert(1, './BASS_only_original/')
import bass as md
import numpy as np
import os
import pickle
def getPosteriorProbabilities(data_explo_hmm, lengths_explo_hmm, model_fit):
lengths_explo = lengths_explo_hmm[:]
data_explo = data_explo_hmm[:np.sum(lengths_explo)]
Hexplo = -model_fit.score(dat... | en | 0.407638 | #entropy # transmat_, stationary_probs_ = md.compute_transmat(Yexplo) # a,b,c = md.test_for_markovianity(Yexplo,w_dict_explo,eps,p_d,transmat_, stationary_probs_) # res = {"P_w_explo_All" : results[0], "nbInstances_All" : results[1], "w_dict_explo_All" : results[2]} | 2.186306 | 2 |
plist/__init__.py | ziank/plist2json | 4 | 6624116 | # -*- coding:utf-8 -*-
#authour:ziank | # -*- coding:utf-8 -*-
#authour:ziank | en | 0.584103 | # -*- coding:utf-8 -*- #authour:ziank | 0.979771 | 1 |
ad_api/api/sd/creatives.py | mkdir700/python-amazon-ad-api | 12 | 6624117 | <gh_stars>10-100
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
class Creatives(Client):
@sp_endpoint('/sd/creatives', method='GET')
def list_creatives(self, **kwargs) -> ApiResponse:
return self._request(kwargs.pop('path'), params=kwargs)
@sp_endpoint('/sd/creatives'... | from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
class Creatives(Client):
@sp_endpoint('/sd/creatives', method='GET')
def list_creatives(self, **kwargs) -> ApiResponse:
return self._request(kwargs.pop('path'), params=kwargs)
@sp_endpoint('/sd/creatives', method='PUT')
... | en | 0.110607 | # print(kwargs.get('body')) #'not a valid key=value pair (missing equal-sign) in ' | 2.01977 | 2 |
build/lib/vicedtools/vce/schoolscores.py | gregbreese/vicedtools | 2 | 6624118 | # Copyright 2021 VicEdTools authors
# 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 writi... | # Copyright 2021 VicEdTools authors
# 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 writi... | en | 0.822181 | # Copyright 2021 VicEdTools authors # 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,... | 3.610427 | 4 |
machine-learning/coursera_exercises/ex1/in_python/exercises/warmUpExercise.py | pk-ai/training | 1 | 6624119 | import numpy as np
def get5by5IdentityMatrix():
return np.identity(5) | import numpy as np
def get5by5IdentityMatrix():
return np.identity(5) | none | 1 | 2.400223 | 2 | |
src/diffie_hellman.py | Calder10/Secure-Chat-with-AES-and-Diffiie-Hellman-Key-Exchange | 0 | 6624120 | <filename>src/diffie_hellman.py
"""
Università degli Studi Di Palermo
Corso di Laurea Magistrale in Informatica
Anno Accademico 2020/2021
Cybersecurity
@author: <NAME>
DH-AES256 - Chatter
"""
from Crypto.Util.number import getPrime,getNRandomBitInteger
from Crypto.Random import get_random_bytes
SIZE_PG=1024
SIZE_PK=5... | <filename>src/diffie_hellman.py
"""
Università degli Studi Di Palermo
Corso di Laurea Magistrale in Informatica
Anno Accademico 2020/2021
Cybersecurity
@author: <NAME>
DH-AES256 - Chatter
"""
from Crypto.Util.number import getPrime,getNRandomBitInteger
from Crypto.Random import get_random_bytes
SIZE_PG=1024
SIZE_PK=5... | it | 0.971864 | Università degli Studi Di Palermo Corso di Laurea Magistrale in Informatica Anno Accademico 2020/2021 Cybersecurity @author: <NAME> DH-AES256 - Chatter Funzione che ritorna un numero primo p che ha una dimensione in bit uguale a quella del parametro dato in input e un intero g compreso tra 1 e p Algorimto quadra e mo... | 3.003412 | 3 |
contentcuration/contentcuration/db/models/manager.py | DXCanas/content-curation | 0 | 6624121 | import contextlib
from django.db import transaction
from django.db.models import Manager
from django.db.models import Q
from django_cte import CTEQuerySet
from mptt.managers import TreeManager
from contentcuration.db.models.query import CustomTreeQuerySet
class CustomManager(Manager.from_queryset(CTEQuerySet)):
... | import contextlib
from django.db import transaction
from django.db.models import Manager
from django.db.models import Q
from django_cte import CTEQuerySet
from mptt.managers import TreeManager
from contentcuration.db.models.query import CustomTreeQuerySet
class CustomManager(Manager.from_queryset(CTEQuerySet)):
... | en | 0.766582 | The CTEManager improperly overrides `get_queryset` # Added 7-31-2018. We can remove this once we are certain we have eliminated all cases # where root nodes are getting prepended rather than appended to the tree list. Creates space for a new tree by incrementing all tree ids greater than ``target_tree_id``. # I... | 2.110534 | 2 |
tools/mqppep/mqppep_mrgfltr.py | eschen42/mqppep | 0 | 6624122 | <filename>tools/mqppep/mqppep_mrgfltr.py
#!/usr/bin/env python
# Import the packages needed
import argparse
import operator # for operator.itemgetter
import os.path
import re
import shutil # for shutil.copyfile(src, dest)
import sqlite3 as sql
import sys # import the sys module for exc_info
import time
import trace... | <filename>tools/mqppep/mqppep_mrgfltr.py
#!/usr/bin/env python
# Import the packages needed
import argparse
import operator # for operator.itemgetter
import os.path
import re
import shutil # for shutil.copyfile(src, dest)
import sqlite3 as sql
import sys # import the sys module for exc_info
import time
import trace... | en | 0.624435 | #!/usr/bin/env python # Import the packages needed # for operator.itemgetter # for shutil.copyfile(src, dest) # import the sys module for exc_info # for formatting stack-trace # global constants # ref: https://stackoverflow.com/a/8915613/15509512 # answers: "How to handle exceptions in a list comprehensions" # usag... | 2.538256 | 3 |
calculate_fitness.py | atr10116068/Genetic_Algorithm_python | 0 | 6624123 | <gh_stars>0
#function fitnes
def fitness(gen,target):
fitnes=0
for x in range(len(target)):
if(target[x:x+1] == gen[x:x+1]):
#print("-> {} sama".format(gen[x:x+1]))
fitnes += 1
fitness = str((fitnes/len(target))*100)
return fitness
| #function fitnes
def fitness(gen,target):
fitnes=0
for x in range(len(target)):
if(target[x:x+1] == gen[x:x+1]):
#print("-> {} sama".format(gen[x:x+1]))
fitnes += 1
fitness = str((fitnes/len(target))*100)
return fitness | en | 0.148303 | #function fitnes #print("-> {} sama".format(gen[x:x+1])) | 3.434464 | 3 |
main.py | haselmann/dev-tracker-reddit | 0 | 6624124 | import praw
import re
from data import ThreadData
from config import config
from collections import deque
from datetime import datetime
from urllib.parse import quote_plus
if __name__ == '__main__':
r = praw.Reddit(client_id=config["client_id"],
client_secret=config["client_secret"],
... | import praw
import re
from data import ThreadData
from config import config
from collections import deque
from datetime import datetime
from urllib.parse import quote_plus
if __name__ == '__main__':
r = praw.Reddit(client_id=config["client_id"],
client_secret=config["client_secret"],
... | en | 0.987716 | # the most recent threads a dev has replied in # author is deleted, don't care about this comment | 2.556285 | 3 |
django_archive/apps.py | nathan-osman/django-archive | 28 | 6624125 | <gh_stars>10-100
from django.apps import AppConfig
class DjangoArchiveConfig(AppConfig):
"""
Configuration for the django_archive app
"""
name = 'django_archive'
verbose_name = "Django Archive"
| from django.apps import AppConfig
class DjangoArchiveConfig(AppConfig):
"""
Configuration for the django_archive app
"""
name = 'django_archive'
verbose_name = "Django Archive" | en | 0.514786 | Configuration for the django_archive app | 1.516111 | 2 |
saga/resource/__init__.py | nikmagini/pilot | 13 | 6624126 |
__author__ = "<NAME>"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
from saga.resource.constants import *
from saga.resource.description import *
from saga.resource.manager import *
from saga.resource.resource import *
|
__author__ = "<NAME>"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
from saga.resource.constants import *
from saga.resource.description import *
from saga.resource.manager import *
from saga.resource.resource import *
| none | 1 | 1.07107 | 1 | |
varfilter/types.py | gomibaya/pyVarfilter | 0 | 6624127 | <reponame>gomibaya/pyVarfilter
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Definiciones de tipos básicos habituales.
Definición de clases para Db,Query y Datos usuarios.
Funciones de conversión a int,bool,float
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, <NAME> ,EBP"
__license__ = "MIT"
__email... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Definiciones de tipos básicos habituales.
Definición de clases para Db,Query y Datos usuarios.
Funciones de conversión a int,bool,float
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, <NAME> ,EBP"
__license__ = "MIT"
__email__ = "<EMAIL>"
__status__ = "Al... | es | 0.839567 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Definiciones de tipos básicos habituales. Definición de clases para Db,Query y Datos usuarios. Funciones de conversión a int,bool,float | 3.343529 | 3 |
zenduty/api/incidents_api.py | Zenduty/zenduty-python-sdk | 0 | 6624128 | from zenduty.api_client import ApiClient
class IncidentsApi(object):
def __init__(self,api_client=None):
if api_client is None:
api_client=ApiClient()
self.api_client = api_client
def get_incidents(self,body):
#Returns the incidents from your zenduty account
#params... | from zenduty.api_client import ApiClient
class IncidentsApi(object):
def __init__(self,api_client=None):
if api_client is None:
api_client=ApiClient()
self.api_client = api_client
def get_incidents(self,body):
#Returns the incidents from your zenduty account
#params... | en | 0.69742 | #Returns the incidents from your zenduty account #params dict body: contains all the required details of your account # Sample body: # {'page':1, # 'status':5, # 'team_id':['a2c6322b-4c1b-4884-8f7a-a7f270de98cb'], # 'service_ids':[], # 'user_ids':[]} #Returns the incidents belo... | 2.53649 | 3 |
references/segmentation/utils.py | burro-robotics/vision | 0 | 6624129 | from collections import defaultdict, deque
import datetime
import time
import torch
import torch.distributed as dist
import errno
import os
import cv2
import numpy as np
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values over a
window or the global series average.
... | from collections import defaultdict, deque
import datetime
import time
import torch
import torch.distributed as dist
import errno
import os
import cv2
import numpy as np
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values over a
window or the global series average.
... | en | 0.578494 | Track a series of values and provide access to smoothed values over a window or the global series average. Warning: does not synchronize the deque! This function disables printing when not in master process # m = torch.tensor([0.485, 0.456, 0.406], dtype=torch.float32) # s = torch.tensor([0.229, 0.224, 0.225], dtyp... | 2.491872 | 2 |
tools/yolov3roi.py | tanishq1g/visual-grounding-NMTree | 0 | 6624130 | import random
import numpy as np
import torch
import pickle
from functools import partial
import sys
import time
from PIL import Image, ImageDraw
sys.path.append(sys.path[0] + "/..")
sys.path.append(sys.path[0] + "/../yolov3")
print(sys.path)
from yolov3.utils import *
from yolov3.image import letterbox_image, correct... | import random
import numpy as np
import torch
import pickle
from functools import partial
import sys
import time
from PIL import Image, ImageDraw
sys.path.append(sys.path[0] + "/..")
sys.path.append(sys.path[0] + "/../yolov3")
print(sys.path)
from yolov3.utils import *
from yolov3.image import letterbox_image, correct... | en | 0.423241 | # # self.yolo.print_network() # get reverse coordinates for yolov3 model # im_w, im_h = float(im_w), float(im_h) # net_w, net_h = float(net_w), float(net_h) # if net_w/im_w < net_h/im_h: # new_w = net_w # new_h = (im_h * net_w)/im_w # else: # new_w = (im_w * net_h)/im_h # new_h = net_h # xo, xs = (net_w - new_w)/(2*net... | 2.2179 | 2 |
src/main.py | VU-BEAM-Lab/DNNBeamforming | 1 | 6624131 | # Copyright 2020 <NAME>, <NAME>, and <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 w... | # Copyright 2020 <NAME>, <NAME>, and <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 w... | en | 0.61609 | # Copyright 2020 <NAME>, <NAME>, and <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 writ... | 1.97731 | 2 |
preacher/compilation/yaml/__init__.py | lasta/preacher | 0 | 6624132 | """
YAML handling.
"""
from .error import YamlError
from .loader import load, load_all, load_from_path, load_all_from_path
__all__ = [
'YamlError',
'load',
'load_from_path',
'load_all',
'load_all_from_path',
]
| """
YAML handling.
"""
from .error import YamlError
from .loader import load, load_all, load_from_path, load_all_from_path
__all__ = [
'YamlError',
'load',
'load_from_path',
'load_all',
'load_all_from_path',
]
| en | 0.641523 | YAML handling. | 1.521476 | 2 |
migrations/versions/535906879d1f_db_small_fixes.py | asidlare/todos | 0 | 6624133 | """db small fixes
Revision ID: 535906879d1f
Revises: <KEY>
Create Date: 2019-08-13 18:52:54.607312
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '535906879d1f'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands ... | """db small fixes
Revision ID: 535906879d1f
Revises: <KEY>
Create Date: 2019-08-13 18:52:54.607312
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '535906879d1f'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands ... | en | 0.506282 | db small fixes Revision ID: 535906879d1f Revises: <KEY> Create Date: 2019-08-13 18:52:54.607312 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ... | 1.303475 | 1 |
resources/gubbana.py | leondz/bornholmsk | 0 | 6624134 | <reponame>leondz/bornholmsk<gh_stars>0
#!/usr/bin/env python3
import bs4
soup = bs4.BeautifulSoup(open('view-source_gubbana.dk_borrinjholmsk_.html','r'), features='html.parser')
c1 = soup.find_all('td', {'class':'column-1'})
c2 = soup.find_all('td', {'class':'column-2'})
c3 = soup.find_all('td', {'class':'column-3'})... | #!/usr/bin/env python3
import bs4
soup = bs4.BeautifulSoup(open('view-source_gubbana.dk_borrinjholmsk_.html','r'), features='html.parser')
c1 = soup.find_all('td', {'class':'column-1'})
c2 = soup.find_all('td', {'class':'column-2'})
c3 = soup.find_all('td', {'class':'column-3'})
c4 = soup.find_all('td', {'class':'col... | fr | 0.221828 | #!/usr/bin/env python3 | 2.69381 | 3 |
task_viewer/urls.py | farahaulita/pbp-tk | 0 | 6624135 | from django.urls import path
from .views import view_task, view_subject_task
urlpatterns = [
path('view-task/<str:name>/<int:identitas>/<str:tambahan>', view_task, name='view-task'),
path('view-subject-task/<str:name>/<int:identitas>/<str:tambahan>/<int:id>', view_subject_task, name='view-subject-task'),
] | from django.urls import path
from .views import view_task, view_subject_task
urlpatterns = [
path('view-task/<str:name>/<int:identitas>/<str:tambahan>', view_task, name='view-task'),
path('view-subject-task/<str:name>/<int:identitas>/<str:tambahan>/<int:id>', view_subject_task, name='view-subject-task'),
] | none | 1 | 1.611288 | 2 | |
lcdfonteditor/ui/ui.py | KiLLAAA/LCD_Font_Editor | 1 | 6624136 | <filename>lcdfonteditor/ui/ui.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020, <NAME> aka KiLLA
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code ... | <filename>lcdfonteditor/ui/ui.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020, <NAME> aka KiLLA
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code ... | en | 0.444347 | #!/usr/bin/env python # -*- coding: utf-8 -*- Copyright (c) 2020, <NAME> aka KiLLA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice... | 1.122421 | 1 |
berliner/utils/machine.py | hypergravity/berliner | 4 | 6624137 | import numpy as np
from emcee import EnsembleSampler
from .ls import wls_simple
class TGMMachine():
""" the TGM Machine class """
def __init__(self, isoc_stacked, tgm_cols=("teff", "logg", "_mhini"),
tgm_sigma=(100, 0.2, 0.1), w_sigma=(100, 0.2, 0.1),
pred_cols=("teff", "lo... | import numpy as np
from emcee import EnsembleSampler
from .ls import wls_simple
class TGMMachine():
""" the TGM Machine class """
def __init__(self, isoc_stacked, tgm_cols=("teff", "logg", "_mhini"),
tgm_sigma=(100, 0.2, 0.1), w_sigma=(100, 0.2, 0.1),
pred_cols=("teff", "lo... | en | 0.595417 | the TGM Machine class the input should be a stacked table of isochrones # stacked isochrones # TGM array # TGM sigma # Qs to predict # weight array predict MLE of SED and weight at the given TGM position # smooth weight in a wider volume the TG Machine class # 4 stands for [Teff, logg, Av, DM] # number of chains # init... | 2.499905 | 2 |
sensordata_generator.py | jessicasena/WearableSensorDataGenerator | 2 | 6624138 | # ---------------------------------------------------------------------------------
# Keras DataGenerator for datasets from the benchmark "Human Activity Recognition
# Based on Wearable Sensor Data: A Standardization of the State-of-the-Art"
#
# The data used here is created by the npz_to_fold.py file.
#
# (C) 20... | # ---------------------------------------------------------------------------------
# Keras DataGenerator for datasets from the benchmark "Human Activity Recognition
# Based on Wearable Sensor Data: A Standardization of the State-of-the-Art"
#
# The data used here is created by the npz_to_fold.py file.
#
# (C) 20... | en | 0.672376 | # --------------------------------------------------------------------------------- # Keras DataGenerator for datasets from the benchmark "Human Activity Recognition # Based on Wearable Sensor Data: A Standardization of the State-of-the-Art" # # The data used here is created by the npz_to_fold.py file. # # (C) 2020 <NA... | 3.13194 | 3 |
Expenses/urls.py | adithyanps/netprofit-django | 0 | 6624139 | <gh_stars>0
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
ExpenseCategoryViewSet,
ExpenseViewSet,
)
router = DefaultRouter()
router.register('expense-category', ExpenseCategoryViewSet)
router.register('expenses', Expense... | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
ExpenseCategoryViewSet,
ExpenseViewSet,
)
router = DefaultRouter()
router.register('expense-category', ExpenseCategoryViewSet)
router.register('expenses', ExpenseViewSet)
... | en | 0.374488 | # router.register('sales-partner-chart', SalesPartnerChartViewset,base_name='CustomersYearChart') # router.register('sales-year-chart', SalesYearIncomeChartViewset,base_name='SalesYearChart') # router.register('sales-PartnerWithYear-chart', Sales_PartnerWithYear_ChartViewSet,base_name='Sales_PartnerWithYearChart') # ro... | 1.890561 | 2 |
tests/unit/test_seed.py | man-group/hiveminder | 5 | 6624140 | from hiveminder.seed import Seed
from hiveminder.headings import heading_to_delta, LEGAL_HEADINGS
from hiveminder._util import is_even
from mock import sentinel
import pytest
def test_can_not_hash_a_seed():
h = Seed(sentinel.x, sentinel.y, sentinel.h)
with pytest.raises(TypeError) as err:
hash(h)
... | from hiveminder.seed import Seed
from hiveminder.headings import heading_to_delta, LEGAL_HEADINGS
from hiveminder._util import is_even
from mock import sentinel
import pytest
def test_can_not_hash_a_seed():
h = Seed(sentinel.x, sentinel.y, sentinel.h)
with pytest.raises(TypeError) as err:
hash(h)
... | en | 0.925018 | # Original instance is not actually changed # Rather than patch heading_to_delta in Seed.advance we just # assert that the effect of advancing the seed matches that # defined by heading_to_delta # Original instance is not actually changed # Original instance is not actually changed | 2.475602 | 2 |
examples/chording_example.py | thomas-weigel/thuja | 1 | 6624141 | <filename>examples/chording_example.py
from thuja.itemstream import notetypes
from thuja.itemstream import Itemstream
from thuja.generator import Generator
from thuja.generator import keys
from thuja import csound_utils
rhythms = Itemstream("q",
tempo=120,
notetype=notetypes.r... | <filename>examples/chording_example.py
from thuja.itemstream import notetypes
from thuja.itemstream import Itemstream
from thuja.generator import Generator
from thuja.generator import keys
from thuja import csound_utils
rhythms = Itemstream("q",
tempo=120,
notetype=notetypes.r... | none | 1 | 2.419048 | 2 | |
examples/expe_conv_logreg/figure_logreg.py | idc9/andersoncd | 0 | 6624142 | import pandas
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from andersoncd.plot_utils import configure_plt, _plot_legend_apart
configure_plt()
current_palette = sns.color_palette("colorblind")
dict_color = {}
dict_color["pgd"] = current_palette[0]
dict_color["fista"] = current_palette[0]... | import pandas
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from andersoncd.plot_utils import configure_plt, _plot_legend_apart
configure_plt()
current_palette = sns.color_palette("colorblind")
dict_color = {}
dict_color["pgd"] = current_palette[0]
dict_color["fista"] = current_palette[0]... | none | 1 | 2.344579 | 2 | |
Curso Udemy 2022/Curso_Luiz_Otavio/rascunho.py | Matheusfarmaceutico/Exercicios-Python | 0 | 6624143 | from random import randint
while True:
try:
quantos = int(input('Quantos CPFs gostaria de gerar? '))
except:
print('Caracter Inválido! Tente novamente.')
continue
lista = []
for c in range(quantos):
cpf = str(randint(100000000,999999999))
novo_cpf = cpf
re... | from random import randint
while True:
try:
quantos = int(input('Quantos CPFs gostaria de gerar? '))
except:
print('Caracter Inválido! Tente novamente.')
continue
lista = []
for c in range(quantos):
cpf = str(randint(100000000,999999999))
novo_cpf = cpf
re... | none | 1 | 3.368083 | 3 | |
tests/unit/test_debug.py | RBrearton/islatu | 0 | 6624144 | <reponame>RBrearton/islatu
"""
This module contains a couple of simple tests for Islatu's debugger.
"""
from islatu.debug import debug
def test_debug_default_log_lvl():
"""
Make sure that the debugger starts out with a logging_lvl of 1.
"""
assert debug.logging_level == 1
def test_debug_log_lvl_cha... | """
This module contains a couple of simple tests for Islatu's debugger.
"""
from islatu.debug import debug
def test_debug_default_log_lvl():
"""
Make sure that the debugger starts out with a logging_lvl of 1.
"""
assert debug.logging_level == 1
def test_debug_log_lvl_change():
"""
Make sur... | en | 0.862165 | This module contains a couple of simple tests for Islatu's debugger. Make sure that the debugger starts out with a logging_lvl of 1. Make sure that we can change the logging level, if required. | 2.263861 | 2 |
URCALC.py | piyushgarg116/codechef-solution | 5 | 6624145 | def URCALC():
ans=0.00000000
a=(float)(input())
b=(float)(input())
operator=raw_input()
if operator=="+":
ans=a+b
elif operator=="-":
ans=a-b
elif operator=="*":
ans=a*b
else:
ans=a/b
print ans
URCALC();
| def URCALC():
ans=0.00000000
a=(float)(input())
b=(float)(input())
operator=raw_input()
if operator=="+":
ans=a+b
elif operator=="-":
ans=a-b
elif operator=="*":
ans=a*b
else:
ans=a/b
print ans
URCALC();
| none | 1 | 3.830186 | 4 | |
books_database_oop/personal_bookstore.py | rachida-sghr/misc-python | 1 | 6624146 | <filename>books_database_oop/personal_bookstore.py
from tkinter import *
from backend import Database
database = Database("books.db")
class Window:
def __init__(self, window):
self.window=window
self.window.wm_title("My Books")
# title
label_title=Label(window, text="Title")
label_title.grid(row=0, col... | <filename>books_database_oop/personal_bookstore.py
from tkinter import *
from backend import Database
database = Database("books.db")
class Window:
def __init__(self, window):
self.window=window
self.window.wm_title("My Books")
# title
label_title=Label(window, text="Title")
label_title.grid(row=0, col... | en | 0.567808 | # title # author # year # country # borrowed # list box and attached scroll bar # get_selected_row function is triggered when user select an item in the listbox # scrollbar=Scrollbar(window) # scrollbar.grid(row=2,column=2,rowspan=6) # listbox.configure(yscrollcommand=scrollbar.set) # scrollbar.configure(command=listbo... | 3.822687 | 4 |
satchless/cart/handler.py | cajun-code/satchless | 1 | 6624147 | <reponame>cajun-code/satchless
from django.shortcuts import redirect
from ..product.forms import NonConfigurableVariantForm
from ..product.models import ProductAbstract, Variant
from ..product.signals import product_view, variant_formclass_for_product
from . import forms
from . import models
class AddToCartHandler(ob... | from django.shortcuts import redirect
from ..product.forms import NonConfigurableVariantForm
from ..product.models import ProductAbstract, Variant
from ..product.signals import product_view, variant_formclass_for_product
from . import forms
from . import models
class AddToCartHandler(object):
"""
Parametrized... | en | 0.766812 | Parametrized handler for `product_view`, which produces *add to cart* forms, validates them and performs all the logic of adding an item to a cart. Sets up a parametrized handler for product view. Accepts: * `typ`: the type of the cart to add to * `addtocart_formclass`: form class ... | 2.279517 | 2 |
1-100/17/17.py | Thomaw/Project-Euler | 0 | 6624148 | <reponame>Thomaw/Project-Euler<gh_stars>0
s={0:"",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six"/
,7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven"/
,12:"twelve",13:"thirteen",14:"fourteen",15:"fifteen"/
,16:"sixteen",17:"seventeen",18:"eighteen",19:"nineteen"/
,20:"twenty",30:"thirty",40:"forty",50:"fifty"/
,60:... | s={0:"",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six"/
,7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven"/
,12:"twelve",13:"thirteen",14:"fourteen",15:"fifteen"/
,16:"sixteen",17:"seventeen",18:"eighteen",19:"nineteen"/
,20:"twenty",30:"thirty",40:"forty",50:"fifty"/
,60:"sixty",70:"seventy",80:"eighty",90:"ninet... | none | 1 | 2.957864 | 3 | |
control/script/attack.py | bianzhenkun/IntelligentShip | 1 | 6624149 | #!/usr/bin/env python3
"""
Stanley Control
Author: SheffieldWang
"""
#import basic
import math
import numpy as np
#import ROS
import rospy
from nav_msgs.msg import Path
from std_msgs.msg import Int64,Bool
from geometry_msgs.msg import PoseStamped
from control.msg import Command
class AttackNode():
def __init_... | #!/usr/bin/env python3
"""
Stanley Control
Author: SheffieldWang
"""
#import basic
import math
import numpy as np
#import ROS
import rospy
from nav_msgs.msg import Path
from std_msgs.msg import Int64,Bool
from geometry_msgs.msg import PoseStamped
from control.msg import Command
class AttackNode():
def __init_... | en | 0.277076 | #!/usr/bin/env python3 Stanley Control Author: SheffieldWang #import basic #import ROS #command # 3 attack # 0:no run 1:run # attack_flag #voice flag #ros # voice sub #print(self.ai_) #rospy.sleep(0.1) | 2.505961 | 3 |
python-pandas/Python_Pandas/dataframe/CreateDfFromList.py | theumang100/tutorials-1 | 9 | 6624150 | import pandas as pd
df = pd.DataFrame(data=[_ for _ in range(1,6)])
print("DataFrame using list : ")
print(df)
df = pd.DataFrame(data=[['foo','<EMAIL>',],['bar','<EMAIL>'],['buz','<EMAIL>']],columns=['Username','Email'])
print("DataFrame using list with columns attribute : ")
print(df) | import pandas as pd
df = pd.DataFrame(data=[_ for _ in range(1,6)])
print("DataFrame using list : ")
print(df)
df = pd.DataFrame(data=[['foo','<EMAIL>',],['bar','<EMAIL>'],['buz','<EMAIL>']],columns=['Username','Email'])
print("DataFrame using list with columns attribute : ")
print(df) | none | 1 | 3.975735 | 4 |