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 |
|---|---|---|---|---|---|---|---|---|---|---|
drink_partners/partners/tests/views/test_search_partner_view.py | henriquebraga/drink-partners | 0 | 6000 | from drink_partners.contrib.samples import partner_bar_legal
class TestSearchPartner:
async def test_should_return_bad_request_for_str_coordinates(
self,
client,
partner_search_with_str_coordinates_url
):
async with client.get(partner_search_with_str_coordinates_url) as respon... | from drink_partners.contrib.samples import partner_bar_legal
class TestSearchPartner:
async def test_should_return_bad_request_for_str_coordinates(
self,
client,
partner_search_with_str_coordinates_url
):
async with client.get(partner_search_with_str_coordinates_url) as respon... | uz | 0.446344 | # noqa # noqa # noqa | 2.710546 | 3 |
Titanic/class_create_model_of_logistic_regression.py | ysh329/Titanic-Machine-Learning-from-Disaster | 1 | 6001 | <filename>Titanic/class_create_model_of_logistic_regression.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Filename: class_create_model_of_logistic_regression.py
# Description:
#
# Author: <NAME>
# E-mail: <EMAIL>
#... | <filename>Titanic/class_create_model_of_logistic_regression.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Filename: class_create_model_of_logistic_regression.py
# Description:
#
# Author: <NAME>
# E-mail: <EMAIL>
#... | en | 0.393471 | # -*- coding: utf-8 -*- # !/usr/bin/python ################################### PART0 DESCRIPTION ################################# # Filename: class_create_model_of_logistic_regression.py # Description: # # Author: <NAME> # E-mail: <EMAIL> # Create: 2016-01-23 23:32:49 # Last: ################################### PART1 ... | 2.570905 | 3 |
mjecv/io/base.py | mje-nz/mjecv | 0 | 6002 | import multiprocessing
from typing import List, Optional
import numpy as np
from ..util import dill_for_apply
class ImageSequenceWriter:
def __init__(self, pattern, writer, *, max_index=None):
if type(pattern) is not str:
raise ValueError("Pattern must be string")
if pattern.format(1... | import multiprocessing
from typing import List, Optional
import numpy as np
from ..util import dill_for_apply
class ImageSequenceWriter:
def __init__(self, pattern, writer, *, max_index=None):
if type(pattern) is not str:
raise ValueError("Pattern must be string")
if pattern.format(1... | en | 0.833082 | Image sequence writer that uses multiprocessing to save several images in parallel. This falls apart for large objects, as multiprocessing pickles them and pipes them into the subprocesses. # Semaphore's value is number of slots available for tasks to wait in # type: Optional[multiprocessing.synchronize.Se... | 3.03518 | 3 |
377_combination_sum_iv.py | gengwg/leetcode | 2 | 6003 | # 377 Combination Sum IV
# Given an integer array with all positive numbers and no duplicates,
# find the number of possible combinations that add up to a positive integer target.
#
# Example:
#
# nums = [1, 2, 3]
# target = 4
#
# The possible combination ways are:
# (1, 1, 1, 1)
# (1, 1, 2)
# (1, 2, 1)
# (1, 3)
# (2,... | # 377 Combination Sum IV
# Given an integer array with all positive numbers and no duplicates,
# find the number of possible combinations that add up to a positive integer target.
#
# Example:
#
# nums = [1, 2, 3]
# target = 4
#
# The possible combination ways are:
# (1, 1, 1, 1)
# (1, 1, 2)
# (1, 2, 1)
# (1, 3)
# (2,... | en | 0.774006 | # 377 Combination Sum IV # Given an integer array with all positive numbers and no duplicates, # find the number of possible combinations that add up to a positive integer target. # # Example: # # nums = [1, 2, 3] # target = 4 # # The possible combination ways are: # (1, 1, 1, 1) # (1, 1, 2) # (1, 2, 1) # (1, 3) # (2, ... | 3.549427 | 4 |
nvidia-texture-tools/conanfile.py | koeleck/conan-packages | 0 | 6004 | <reponame>koeleck/conan-packages<gh_stars>0
from conans import ConanFile, CMake, tools
import os
STATIC_LIBS = ["nvtt", "squish", "rg_etc1", "nvimage", "bc6h", "posh",
"bc7", "nvmath", "nvthread", "nvcore"]
SHARED_LIBS = ["nvtt", "nvimage", "nvthread", "nvmath", "nvcore"]
class NvidiatexturetoolsConan(... | from conans import ConanFile, CMake, tools
import os
STATIC_LIBS = ["nvtt", "squish", "rg_etc1", "nvimage", "bc6h", "posh",
"bc7", "nvmath", "nvthread", "nvcore"]
SHARED_LIBS = ["nvtt", "nvimage", "nvthread", "nvmath", "nvcore"]
class NvidiatexturetoolsConan(ConanFile):
name = "nvidia-texture-tools... | en | 0.531595 | PROJECT(NV) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() | 1.919732 | 2 |
train_args.py | MyWay/Create-Your-Own-Image-Classifier | 0 | 6005 | <reponame>MyWay/Create-Your-Own-Image-Classifier
#!/usr/bin/env python3
""" train_args.py
train_args.py command-line args.
"""
import argparse
def get_args():
"""
"""
parser = argparse.ArgumentParser(
description="This script lets you train and save your model.",
usage="python3 train.py f... | #!/usr/bin/env python3
""" train_args.py
train_args.py command-line args.
"""
import argparse
def get_args():
"""
"""
parser = argparse.ArgumentParser(
description="This script lets you train and save your model.",
usage="python3 train.py flowers/train --gpu --learning_rate 0.001 --epochs... | en | 0.9169 | #!/usr/bin/env python3 train_args.py train_args.py command-line args. Main Function main() is called if script is executed on it's own. | 2.968998 | 3 |
apps/payment/views.py | canadiyaman/thetask | 0 | 6006 | <reponame>canadiyaman/thetask<filename>apps/payment/views.py<gh_stars>0
from django.http import HttpResponseRedirect
from django.conf import settings
from django.views.generic import TemplateView
from apps.payment.models import PaymentLog
from apps.payment.stripe import get_token, get_payment_charge
from apps.subscrip... | from django.http import HttpResponseRedirect
from django.conf import settings
from django.views.generic import TemplateView
from apps.payment.models import PaymentLog
from apps.payment.stripe import get_token, get_payment_charge
from apps.subscription.views import start_subscription
class ChargeView(TemplateView):
... | none | 1 | 1.984926 | 2 | |
users/apps.py | srinidhibhat/booknotes | 0 | 6007 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
# below piece of code is needed for automatic profile creation for user
def ready(self):
import users.signals
| from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
# below piece of code is needed for automatic profile creation for user
def ready(self):
import users.signals
| en | 0.911588 | # below piece of code is needed for automatic profile creation for user | 1.914703 | 2 |
secure_data_store/cli.py | HumanBrainProject/secure-data-store | 1 | 6008 | <reponame>HumanBrainProject/secure-data-store
# -*- coding: utf-8 -*-
"""Console script for secure_data_store."""
import click
from . import secure_data_store as sds
CONFIG='~/.sdsrc'
@click.group()
def main():
"""Wrapper for GoCryptFS"""
@main.command()
@click.argument('name')
@click.option('--config', help='Pa... | # -*- coding: utf-8 -*-
"""Console script for secure_data_store."""
import click
from . import secure_data_store as sds
CONFIG='~/.sdsrc'
@click.group()
def main():
"""Wrapper for GoCryptFS"""
@main.command()
@click.argument('name')
@click.option('--config', help='Path to config file', default='~/.sdsrc')
def cr... | en | 0.627135 | # -*- coding: utf-8 -*- Console script for secure_data_store. Wrapper for GoCryptFS Create a new secure data container NAME. Open an existing secure data container NAME. Will print path to the opened, clear-text container. Close an opend data container NAME. | 2.547461 | 3 |
Support/Fuego/Pythia/pythia-0.4/packages/pyre/pyre/graph/Node.py | marient/PelePhysics | 1 | 6009 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | pl | 0.272765 | #!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 1998-2003 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 2.281521 | 2 |
cairis/gui/RiskScatterPanel.py | RachelLar/cairis_update | 0 | 6010 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | en | 0.865663 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may... | 1.693906 | 2 |
sdk/python/pulumi_azure/containerservice/get_registry.py | aangelisc/pulumi-azure | 0 | 6011 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | en | 0.800865 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** A collection of values returned by getRegistry. Is the Administrator account enabled for this Container Registry. The Password associate... | 1.867206 | 2 |
contrib/memcache_whisper.py | TimWhalen/graphite-web | 1 | 6012 | <filename>contrib/memcache_whisper.py
#!/usr/bin/env python
# Copyright 2008 Orbitz WorldWide
#
# 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
... | <filename>contrib/memcache_whisper.py
#!/usr/bin/env python
# Copyright 2008 Orbitz WorldWide
#
# 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
... | en | 0.599554 | #!/usr/bin/env python # Copyright 2008 Orbitz WorldWide # # 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 ... | 1.999978 | 2 |
main.py | showtimesynergy/mojify | 0 | 6013 | <gh_stars>0
from PIL import Image
import csv
from ast import literal_eval as make_tuple
from math import sqrt
import argparse
import os.path
def load_img(image):
# load an image as a PIL object
im = Image.open(image).convert('RGBA')
return im
def color_distance(c_tuple1, c_tuple2):
# calculate the c... | from PIL import Image
import csv
from ast import literal_eval as make_tuple
from math import sqrt
import argparse
import os.path
def load_img(image):
# load an image as a PIL object
im = Image.open(image).convert('RGBA')
return im
def color_distance(c_tuple1, c_tuple2):
# calculate the color distanc... | en | 0.825072 | # load an image as a PIL object # calculate the color distance between two rgb tuples # write out emoji grid to txt file # TODO: ZWJ support # generate unicode data from colors | 3.073991 | 3 |
venv/lib/python3.7/site-packages/Xlib/ext/xinput.py | umr-bot/sliding-puzzle-solver-bot | 0 | 6014 | # Xlib.ext.xinput -- XInput extension module
#
# Copyright (C) 2012 Outpost Embedded, LLC
# <NAME> <<EMAIL>>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either versio... | # Xlib.ext.xinput -- XInput extension module
#
# Copyright (C) 2012 Outpost Embedded, LLC
# <NAME> <<EMAIL>>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either versio... | en | 0.831257 | # Xlib.ext.xinput -- XInput extension module # # Copyright (C) 2012 Outpost Embedded, LLC # <NAME> <<EMAIL>> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 #... | 1.509093 | 2 |
vel/notebook/__init__.py | tigerwlin/vel | 273 | 6015 | from .loader import load | from .loader import load | none | 1 | 1.121561 | 1 | |
YourJobAidApi/migrations/0019_remove_category_count_post.py | rayhanrock/django-yourjobaid-api | 1 | 6016 | <reponame>rayhanrock/django-yourjobaid-api
# Generated by Django 3.0.4 on 2020-04-16 23:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('YourJobAidApi', '0018_category_count_post'),
]
operations = [
migrations.RemoveField(
model_na... | # Generated by Django 3.0.4 on 2020-04-16 23:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('YourJobAidApi', '0018_category_count_post'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='count_post... | en | 0.830183 | # Generated by Django 3.0.4 on 2020-04-16 23:10 | 1.32629 | 1 |
easyquant/login/__init__.py | CharlieZhao95/easy-quant | 0 | 6017 | # @Time : 2022/1/26 23:07
# @Author : zhaoyu
# @Site :
# @File : __init__.py.py
# @Software: PyCharm
# @Note : xx | # @Time : 2022/1/26 23:07
# @Author : zhaoyu
# @Site :
# @File : __init__.py.py
# @Software: PyCharm
# @Note : xx | fr | 0.278741 | # @Time : 2022/1/26 23:07 # @Author : zhaoyu # @Site : # @File : __init__.py.py # @Software: PyCharm # @Note : xx | 1.055707 | 1 |
tests/api/test_attributes.py | DowneyTung/saleor | 19 | 6018 | from typing import Union
from unittest import mock
import graphene
import pytest
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.template.defaultfilters import slugify
from graphene.utils.str_converters import to_camel_case
from saleor.core.taxes import zero_money
from sa... | from typing import Union
from unittest import mock
import graphene
import pytest
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.template.defaultfilters import slugify
from graphene.utils.str_converters import to_camel_case
from saleor.core.taxes import zero_money
from sa... | en | 0.538844 | # a new value but with existing slug should raise an error # a new value with a new slug should pass # value that already belongs to the attribute shouldn't be taken into account query($id: ID!) { attribute(id: $id) { id slug } } query { attributes(first: 20) { ... | 1.983631 | 2 |
3-photos/1-chromakey/app.py | rafacm/aws-serverless-workshop-innovator-island | 1 | 6019 | <gh_stars>1-10
import os
import json
import cv2
import logging
import boto3
import botocore
s3 = boto3.client('s3')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def upload_file(file_name, bucket, object_name=None):
"""Upload a file to an S3 bucket
:param file_name: File to upload
:param buc... | import os
import json
import cv2
import logging
import boto3
import botocore
s3 = boto3.client('s3')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def upload_file(file_name, bucket, object_name=None):
"""Upload a file to an S3 bucket
:param file_name: File to upload
:param bucket: Bucket to ... | en | 0.799959 | Upload a file to an S3 bucket :param file_name: File to upload :param bucket: Bucket to upload to :param object_name: S3 object name. If not specified then same as file_name :return: True if file was uploaded, else False # If S3 object_name was not specified, use file_name # Upload the file # get objec... | 2.591208 | 3 |
metrics/overflow.py | DEKHTIARJonathan/pyinstrument | 1 | 6020 | from pyinstrument import Profiler
p = Profiler(use_signal=False)
p.start()
def func(num):
if num == 0:
return
b = 0
for x in range(1,100000):
b += x
return func(num - 1)
func(900)
p.stop()
print(p.output_text())
with open('overflow_out.html', 'w') as f:
f.write(p.output_html(... | from pyinstrument import Profiler
p = Profiler(use_signal=False)
p.start()
def func(num):
if num == 0:
return
b = 0
for x in range(1,100000):
b += x
return func(num - 1)
func(900)
p.stop()
print(p.output_text())
with open('overflow_out.html', 'w') as f:
f.write(p.output_html(... | none | 1 | 2.846877 | 3 | |
scripts/gen_tee_bin.py | wawang621/optee_os | 0 | 6021 | #!/usr/bin/env python3
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2019, Linaro Limited
#
from __future__ import print_function
from __future__ import division
import argparse
import sys
import struct
import re
import hashlib
try:
from elftools.elf.elffile import ELFFile
from elftools.elf.consta... | #!/usr/bin/env python3
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2019, Linaro Limited
#
from __future__ import print_function
from __future__ import division
import argparse
import sys
import struct
import re
import hashlib
try:
from elftools.elf.elffile import ELFFile
from elftools.elf.consta... | en | 0.641659 | #!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2019, Linaro Limited # *** Can't find elftools module. Probably it is not installed on your system. You can install this module with $ apt install python3-pyelftools if you are using Ubuntu. Or try to search for "pyelftools" or "elftools... | 2.117235 | 2 |
CircuitPython_JEplayer_mp3/repeat.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 6022 | <gh_stars>100-1000
# The MIT License (MIT)
#
# Copyright (c) 2020 <NAME> for Adafruit Industries LLC
#
# 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 l... | # The MIT License (MIT)
#
# Copyright (c) 2020 <NAME> for Adafruit Industries LLC
#
# 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 right... | en | 0.77219 | # The MIT License (MIT) # # Copyright (c) 2020 <NAME> for Adafruit Industries LLC # # 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 right... | 2.157613 | 2 |
Kapitel_1/_1_public_private.py | Geralonx/Classes_Tutorial | 1 | 6023 | <reponame>Geralonx/Classes_Tutorial
# --- Klassendeklaration mit Konstruktor --- #
class PC:
def __init__(self, cpu, gpu, ram):
self.cpu = cpu
self.gpu = gpu
self.__ram = ram
# --- Instanziierung einer Klasse ---#
# --- Ich bevorzuge die Initialisierung mit den Keywords --- #
pc_instanz = ... | # --- Klassendeklaration mit Konstruktor --- #
class PC:
def __init__(self, cpu, gpu, ram):
self.cpu = cpu
self.gpu = gpu
self.__ram = ram
# --- Instanziierung einer Klasse ---#
# --- Ich bevorzuge die Initialisierung mit den Keywords --- #
pc_instanz = PC(cpu='Ryzen 7', gpu='RTX2070Super'... | de | 0.967648 | # --- Klassendeklaration mit Konstruktor --- # # --- Instanziierung einer Klasse ---# # --- Ich bevorzuge die Initialisierung mit den Keywords --- # # --- Zugriff auf normale _public_ Attribute --- # # --- Zugriff auf ein _privates_ Attribut --- # # Auskommentiert, da es einen AttributeError schmeißt. # print(pc_instan... | 2.551354 | 3 |
algorithm/dynamic_programming/coin_change/solution.py | delaanthonio/hackerrank | 1 | 6024 | <gh_stars>1-10
#!/usr/bin/env python3
"""
The Coin Change Problem
:author: <NAME>
:hackerrank: https://hackerrank.com/delaanthonio
:problem: https://www.hackerrank.com/challenges/coin-change/problem
"""
from typing import List
def count_ways(amount: int, coins: List[int]) -> int:
"""Return the number of ways we... | #!/usr/bin/env python3
"""
The Coin Change Problem
:author: <NAME>
:hackerrank: https://hackerrank.com/delaanthonio
:problem: https://www.hackerrank.com/challenges/coin-change/problem
"""
from typing import List
def count_ways(amount: int, coins: List[int]) -> int:
"""Return the number of ways we can count to `... | en | 0.510439 | #!/usr/bin/env python3 The Coin Change Problem :author: <NAME> :hackerrank: https://hackerrank.com/delaanthonio :problem: https://www.hackerrank.com/challenges/coin-change/problem Return the number of ways we can count to ``amount`` with values ``coins``. | 3.979262 | 4 |
climbproject/climbapp/admin.py | javawolfpack/ClimbProject | 0 | 6025 | from django.contrib import admin
#from .models import *
from . import models
# Register your models here.
admin.site.register(models.ClimbModel)
| from django.contrib import admin
#from .models import *
from . import models
# Register your models here.
admin.site.register(models.ClimbModel)
| en | 0.774618 | #from .models import * # Register your models here. | 1.351349 | 1 |
setup.py | TheMagicNacho/artemis-nozzle | 0 | 6026 | <reponame>TheMagicNacho/artemis-nozzle<gh_stars>0
# coding: utf-8
from runpy import run_path
from setuptools import setup
# Get the version from the relevant file
d = run_path('skaero/version.py')
__version__ = d['__version__']
setup(
name="scikit-aero",
version=__version__,
description="Aeronautical engi... | # coding: utf-8
from runpy import run_path
from setuptools import setup
# Get the version from the relevant file
d = run_path('skaero/version.py')
__version__ = d['__version__']
setup(
name="scikit-aero",
version=__version__,
description="Aeronautical engineering calculations in Python.",
author="<NAM... | en | 0.875854 | # coding: utf-8 # Get the version from the relevant file | 1.607666 | 2 |
appendix/AI.by.Search/backtracking.search/3-1.eight.queens.py | royqh1979/programming_with_python | 5 | 6027 | """
8皇后问题
使用栈实现回溯法
"""
def print_board(n,count):
print(f"------解.{count}------")
print(" ",end="")
for j in range(n):
print(f"{j:<2}" ,end="")
print()
for i in range(1,n+1):
print(f"{i:<2}",end="")
for j in range(1,n+1):
if queens[i] == j:
print("Q ",end="")
else:
print(" ",end="")
print... | """
8皇后问题
使用栈实现回溯法
"""
def print_board(n,count):
print(f"------解.{count}------")
print(" ",end="")
for j in range(n):
print(f"{j:<2}" ,end="")
print()
for i in range(1,n+1):
print(f"{i:<2}",end="")
for j in range(1,n+1):
if queens[i] == j:
print("Q ",end="")
else:
print(" ",end="")
print... | zh | 0.72464 | 8皇后问题 使用栈实现回溯法 # backtracking # all possible solutions have been tried, quit searching # 列标志 # 主对角线标志 # 副对角线标志 | 3.493315 | 3 |
multimodal_affinities/evaluation/analysis/plots_producer.py | amzn/multimodal-affinities | 6 | 6028 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: CC-BY-4.0
import os
import cv2
from collections import namedtuple
import imageio
from PIL import Image
from random import randrange
import numpy as np
from sklearn.decomposition import PCA
from scipy.spatial.distance import... | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: CC-BY-4.0
import os
import cv2
from collections import namedtuple
import imageio
from PIL import Image
from random import randrange
import numpy as np
from sklearn.decomposition import PCA
from scipy.spatial.distance import... | en | 0.744666 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: CC-BY-4.0 # Required for gif animations # Load background image # Fig size in inches # list of singleton word lists # list of singleton phrase lists # list of list of words (clusters) # Converts from list of labels to list o... | 2.259623 | 2 |
openstates/openstates-master/openstates/de/legislators.py | Jgorsick/Advocacy_Angular | 0 | 6029 | import re
import lxml.html
from openstates.utils import LXMLMixin
from billy.scrape.legislators import LegislatorScraper, Legislator
class DELegislatorScraper(LegislatorScraper,LXMLMixin):
jurisdiction = 'de'
def scrape(self, chamber, term):
url = {
'upper': 'http://legis.delaware.gov/l... | import re
import lxml.html
from openstates.utils import LXMLMixin
from billy.scrape.legislators import LegislatorScraper, Legislator
class DELegislatorScraper(LegislatorScraper,LXMLMixin):
jurisdiction = 'de'
def scrape(self, chamber, term):
url = {
'upper': 'http://legis.delaware.gov/l... | en | 0.889805 | #for the senate, it's the same table #but the html is hard-coded in js. #same table for the house, but kindly in actual html # this opens the committee section without having to do another request # party is in one of these # Email # Offices #this is enormously painful, DE. #in some trs the photo is the first td #offic... | 2.890781 | 3 |
simpleredial/dataloader/fine_grained_test_dataloader.py | gmftbyGMFTBY/SimpleReDial-v1 | 36 | 6030 | <gh_stars>10-100
from header import *
from .utils import *
from .util_func import *
'''Only for Testing'''
class FineGrainedTestDataset(Dataset):
def __init__(self, vocab, path, **args):
self.args = args
self.vocab = vocab
self.vocab.add_tokens(['[EOS]'])
self.pad = self.voca... | from header import *
from .utils import *
from .util_func import *
'''Only for Testing'''
class FineGrainedTestDataset(Dataset):
def __init__(self, vocab, path, **args):
self.args = args
self.vocab = vocab
self.vocab.add_tokens(['[EOS]'])
self.pad = self.vocab.convert_tokens_... | en | 0.75395 | Only for Testing # ignore [CLS] and [SEP] # ignore [CLS] and [SEP] | 2.272263 | 2 |
dabing/DABING-MIB.py | SvajkaJ/dabing | 0 | 6031 | <filename>dabing/DABING-MIB.py
#
# PySNMP MIB module DABING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file://..\DABING-MIB.mib
# Produced by pysmi-0.3.4 at Tue Mar 22 12:53:47 2022
# On host ? platform ? version ? by user ?
# Using Python version 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bi... | <filename>dabing/DABING-MIB.py
#
# PySNMP MIB module DABING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file://..\DABING-MIB.mib
# Produced by pysmi-0.3.4 at Tue Mar 22 12:53:47 2022
# On host ? platform ? version ? by user ?
# Using Python version 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bi... | en | 0.528646 | # # PySNMP MIB module DABING-MIB (http://snmplabs.com/pysmi) # ASN.1 source file://..\DABING-MIB.mib # Produced by pysmi-0.3.4 at Tue Mar 22 12:53:47 2022 # On host ? platform ? version ? by user ? # Using Python version 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] # | 1.606668 | 2 |
parameter_setup/run_setup_extra_vis.py | kharris/allen-voxel-network | 7 | 6032 | import os
import numpy as np
save_stem='extra_vis_friday_harbor'
data_dir='../../data/sdk_new_100'
resolution=100
cre=False
source_acronyms=['VISal','VISam','VISl','VISp','VISpl','VISpm',
'VISli','VISpor','VISrl','VISa']
lambda_list = np.logspace(3,12,10)
scale_lambda=True
min_vox=0
# save_file_name='... | import os
import numpy as np
save_stem='extra_vis_friday_harbor'
data_dir='../../data/sdk_new_100'
resolution=100
cre=False
source_acronyms=['VISal','VISam','VISl','VISp','VISpl','VISpm',
'VISli','VISpor','VISrl','VISa']
lambda_list = np.logspace(3,12,10)
scale_lambda=True
min_vox=0
# save_file_name='... | en | 0.281761 | # save_file_name='visual_output.hdf5' #source_coverage=0.90 #source_shell = 1 | 1.752306 | 2 |
examples/runall.py | GNiklas/MOSSEPy | 0 | 6033 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 20 09:42:39 2020
@author: niklas
"""
from mossepy.mosse_tracker import MOSSE
# choose position of object in first frame
# that should be done by mouse click
objPos = [256, 256]
# choose tracker type
tracker = MOSSE()
# initialize object position ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 20 09:42:39 2020
@author: niklas
"""
from mossepy.mosse_tracker import MOSSE
# choose position of object in first frame
# that should be done by mouse click
objPos = [256, 256]
# choose tracker type
tracker = MOSSE()
# initialize object position ... | en | 0.709147 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Fri Nov 20 09:42:39 2020 @author: niklas # choose position of object in first frame # that should be done by mouse click # choose tracker type # initialize object position in first frame # start tracking | 2.734883 | 3 |
core/formulas.py | mike006322/PolynomialCalculator | 0 | 6034 | def solve(polynomial):
"""
input is polynomial
if more than one variable, returns 'too many variables'
looks for formula to apply to coefficients
returns solution or 'I cannot solve yet...'
"""
if len(polynomial.term_matrix[0]) > 2:
return 'too many variables'
elif len(polynomial... | def solve(polynomial):
"""
input is polynomial
if more than one variable, returns 'too many variables'
looks for formula to apply to coefficients
returns solution or 'I cannot solve yet...'
"""
if len(polynomial.term_matrix[0]) > 2:
return 'too many variables'
elif len(polynomial... | en | 0.741258 | input is polynomial if more than one variable, returns 'too many variables' looks for formula to apply to coefficients returns solution or 'I cannot solve yet...' input is single-variable polynomial of degree 2 returns zeros returns boolean whether abs(a-b) is less than abs_total or rel_total*max(a, b) ... | 3.826702 | 4 |
manim/mobject/svg/style_utils.py | 5Points7Edges/manim | 0 | 6035 | <reponame>5Points7Edges/manim
"""Utility functions for parsing SVG styles."""
__all__ = ["cascade_element_style", "parse_style", "parse_color_string"]
from xml.dom.minidom import Element as MinidomElement
from colour import web2hex
from ...utils.color import rgb_to_hex
from typing import Dict, List
CASCADING_STYL... | """Utility functions for parsing SVG styles."""
__all__ = ["cascade_element_style", "parse_style", "parse_color_string"]
from xml.dom.minidom import Element as MinidomElement
from colour import web2hex
from ...utils.color import rgb_to_hex
from typing import Dict, List
CASCADING_STYLING_ATTRIBUTES: List[str] = [
... | en | 0.690665 | Utility functions for parsing SVG styles. # The default styling specifications for SVG images, # according to https://www.w3.org/TR/SVG/painting.html # (ctrl-F for "initial") Collect the element's style attributes based upon both its inheritance and its own attributes. SVG uses cascading element styles. A closer a... | 2.817383 | 3 |
iotrigger.py | mm011106/iotrigger | 0 | 6036 | #!/usr/bin/env python
#coding:utf-8
import os
import RPi.GPIO as GPIO #
import json
from time import sleep #
from twython import Twython
f=open("tw_config.json",'r')
config=json.load(f)
f.close()
CONSUMER_KEY =config['consumer_key']
CONSUMER_SECRET =config['consumer_secret']
ACCESS_TOKEN =config['access_token']
ACCE... | #!/usr/bin/env python
#coding:utf-8
import os
import RPi.GPIO as GPIO #
import json
from time import sleep #
from twython import Twython
f=open("tw_config.json",'r')
config=json.load(f)
f.close()
CONSUMER_KEY =config['consumer_key']
CONSUMER_SECRET =config['consumer_secret']
ACCESS_TOKEN =config['access_token']
ACCE... | en | 0.588798 | #!/usr/bin/env python #coding:utf-8 # # #time stamp # get CPU temperature # # | 2.567596 | 3 |
src/wheezy/template/tests/test_utils.py | nxsofsys/wheezy.template | 2 | 6037 |
""" Unit tests for ``wheezy.templates.utils``.
"""
import unittest
class FindAllBalancedTestCase(unittest.TestCase):
""" Test the ``find_all_balanced``.
"""
def test_start_out(self):
""" The start index is out of range.
"""
from wheezy.template.utils import find_all_balanced
... |
""" Unit tests for ``wheezy.templates.utils``.
"""
import unittest
class FindAllBalancedTestCase(unittest.TestCase):
""" Test the ``find_all_balanced``.
"""
def test_start_out(self):
""" The start index is out of range.
"""
from wheezy.template.utils import find_all_balanced
... | en | 0.851902 | Unit tests for ``wheezy.templates.utils``. Test the ``find_all_balanced``. The start index is out of range. If text doesn't start with ``([`` return. Separators are not balanced. Separators are balanced. Test the ``find_balanced``. The start index is out of range. If text doesn't start with ``start_sep`` return. Separa... | 3.294946 | 3 |
akshare/economic/macro_constitute.py | peterrosetu/akshare | 1 | 6038 | <gh_stars>1-10
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2019/10/21 12:08
Desc: 获取金十数据-数据中心-主要机构-宏观经济
"""
import json
import time
import pandas as pd
import requests
from tqdm import tqdm
from akshare.economic.cons import (
JS_CONS_GOLD_ETF_URL,
JS_CONS_SLIVER_ETF_URL,
JS_CONS_OPEC_URL,
)
... | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2019/10/21 12:08
Desc: 获取金十数据-数据中心-主要机构-宏观经济
"""
import json
import time
import pandas as pd
import requests
from tqdm import tqdm
from akshare.economic.cons import (
JS_CONS_GOLD_ETF_URL,
JS_CONS_SLIVER_ETF_URL,
JS_CONS_OPEC_URL,
)
def macro_cons_... | zh | 0.204596 | # -*- coding:utf-8 -*- # /usr/bin/env python Date: 2019/10/21 12:08 Desc: 获取金十数据-数据中心-主要机构-宏观经济 全球最大黄金ETF—SPDR Gold Trust持仓报告, 数据区间从20041118-至今 :return: pandas.Series 2004-11-18 8.09 2004-11-19 57.85 2004-11-22 87.09 2004-11-23 87.09 2004-11-24 96.42 ... ... | 2.370909 | 2 |
test/testers/winforms/scrollbar/__init__.py | ABEMBARKA/monoUI | 1 | 6039 |
##############################################################################
# Written by: <NAME> <<EMAIL>>
# Date: 08/06/2008
# Description: Application wrapper for scrollbar.py
# Used by the scrollbar-*.py tests
##############################################################################$
'... |
##############################################################################
# Written by: <NAME> <<EMAIL>>
# Date: 08/06/2008
# Description: Application wrapper for scrollbar.py
# Used by the scrollbar-*.py tests
##############################################################################$
'... | de | 0.435779 | ############################################################################## # Written by: <NAME> <<EMAIL>> # Date: 08/06/2008 # Description: Application wrapper for scrollbar.py # Used by the scrollbar-*.py tests ##############################################################################$ # m... | 2.343639 | 2 |
save_tweets.py | iglesiasmanu/data_analysis | 0 | 6040 | import json
from os import path
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
from sqlalchemy.orm.exc import NoResultFound
from database import session, Tweet, Hashtag, User
consumer_key = "0qFf4T2xPWVIycLmAwk3rDQ55"
consumer_secret = "<KEY>"
access_token = "<KEY>"
acces_token_... | import json
from os import path
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
from sqlalchemy.orm.exc import NoResultFound
from database import session, Tweet, Hashtag, User
consumer_key = "0qFf4T2xPWVIycLmAwk3rDQ55"
consumer_secret = "<KEY>"
access_token = "<KEY>"
acces_token_... | en | 0.832453 | #Slightly dangerous due to circular references>> #this method is define in this file #alias to shorten calls #alias for shorten calls | 2.838914 | 3 |
app/views/main.py | chrisjws-harness/flaskSaaS | 0 | 6041 | from flask import render_template, jsonify
from app import app
import random
@app.route('/')
@app.route('/index')
def index():
# Feature flags init goes here!
#
# noinspection PyDictCreation
flags = {
"welcome_text": "welcome to my python FF tutorial!"
}
# Flag goes here!
#... | from flask import render_template, jsonify
from app import app
import random
@app.route('/')
@app.route('/index')
def index():
# Feature flags init goes here!
#
# noinspection PyDictCreation
flags = {
"welcome_text": "welcome to my python FF tutorial!"
}
# Flag goes here!
#... | en | 0.38324 | # Feature flags init goes here! # # noinspection PyDictCreation # Flag goes here! # | 2.722561 | 3 |
base_sample/numpy_mat.py | keepangry/ai_algorithm | 2 | 6042 | # encoding: utf-8
'''
@author: yangsen
@license:
@contact:
@software:
@file: numpy_mat.py
@time: 18-8-25 下午9:56
@desc:
'''
import numpy as np
a = np.arange(9).reshape(3,3)
# 行
a[1]
a[[1,2]]
a[np.array([1,2])]
# 列
a[:,1]
a[:,[1,2]]
a[:,np.array([1,2])] | # encoding: utf-8
'''
@author: yangsen
@license:
@contact:
@software:
@file: numpy_mat.py
@time: 18-8-25 下午9:56
@desc:
'''
import numpy as np
a = np.arange(9).reshape(3,3)
# 行
a[1]
a[[1,2]]
a[np.array([1,2])]
# 列
a[:,1]
a[:,[1,2]]
a[:,np.array([1,2])] | en | 0.370694 | # encoding: utf-8 @author: yangsen @license: @contact: @software: @file: numpy_mat.py @time: 18-8-25 下午9:56 @desc: # 行 # 列 | 2.473933 | 2 |
ai_traineree/agents/rainbow.py | laszukdawid/ai-traineree | 22 | 6043 | import copy
from typing import Callable, Dict, List, Optional
import torch
import torch.nn as nn
import torch.optim as optim
from ai_traineree import DEVICE
from ai_traineree.agents import AgentBase
from ai_traineree.agents.agent_utils import soft_update
from ai_traineree.buffers import NStepBuffer, PERBuffer
from ai... | import copy
from typing import Callable, Dict, List, Optional
import torch
import torch.nn as nn
import torch.optim as optim
from ai_traineree import DEVICE
from ai_traineree.agents import AgentBase
from ai_traineree.agents.agent_utils import soft_update
from ai_traineree.buffers import NStepBuffer, PERBuffer
from ai... | en | 0.797271 | Rainbow agent as described in [1]. Rainbow is a DQN agent with some improvments that were suggested before 2017. As mentioned by the authors it's not exhaustive improvment but all changes are in relatively separate areas so their connection makes sense. These improvements are: * Priority Experience Rep... | 2.280498 | 2 |
nvvm/core/nvvm.py | uchytilc/PyCu | 0 | 6044 | <filename>nvvm/core/nvvm.py
from pycu.nvvm import (get_libdevice, ir_version, version, add_module_to_program, compile_program,
create_program, destroy_program, get_compiled_result, get_compiled_result_size,
get_program_log, get_program_log_size, lazy_add_module_to_program, verify_program)
import os
imp... | <filename>nvvm/core/nvvm.py
from pycu.nvvm import (get_libdevice, ir_version, version, add_module_to_program, compile_program,
create_program, destroy_program, get_compiled_result, get_compiled_result_size,
get_program_log, get_program_log_size, lazy_add_module_to_program, verify_program)
import os
imp... | en | 0.655593 | # #key: arch associated with libdevice (None indicates libdevice is not arch specific) # #value: libdevice source # libdevice = {} # #key:given arch # #value: closest available arch found # searched_arch = {} # libdevice = self.libdevice.get(arch, None) # if libdevice is None: # #note: use False instead of None in sea... | 2.098095 | 2 |
fieldservice/fieldservice/doctype/fieldservice_settings/test_fieldservice_settings.py | itsdaveit/fieldservice | 0 | 6045 | <gh_stars>0
# Copyright (c) 2022, itsdve GmbH and Contributors
# See license.txt
# import frappe
import unittest
class TestFieldserviceSettings(unittest.TestCase):
pass
| # Copyright (c) 2022, itsdve GmbH and Contributors
# See license.txt
# import frappe
import unittest
class TestFieldserviceSettings(unittest.TestCase):
pass | en | 0.377666 | # Copyright (c) 2022, itsdve GmbH and Contributors # See license.txt # import frappe | 1.410556 | 1 |
Codes/Data Processing.py | BrickerP/Investment- | 0 | 6046 | <reponame>BrickerP/Investment-
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 21 14:51:01 2021
@author: 75638
"""
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 10000)
def process_data(path1,path2):
'''
1.path1: file path of differen... | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 21 14:51:01 2021
@author: 75638
"""
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 10000)
def process_data(path1,path2):
'''
1.path1: file path of different factor
2.path2:file path... | en | 0.784377 | # -*- coding: utf-8 -*- Created on Sun Nov 21 14:51:01 2021
@author: 75638 1.path1: file path of different factor
2.path2:file path of SP500members
3.remove anomalies
4.normalized data
5.fill NaN with 0 #read factor.xlsx #remove anomalies which is greater than median+5*std or less than median-s*s... | 2.83053 | 3 |
tests/test_env.py | Majanao/pytorch-blender | 381 | 6047 | import pytest
from pathlib import Path
from blendtorch import btt
BLENDDIR = Path(__file__).parent/'blender'
class MyEnv(btt.env.OpenAIRemoteEnv):
def __init__(self, background=True, **kwargs):
super().__init__(version='1.0.0')
self.launch(scene=BLENDDIR/'env.blend', script=BLENDDIR /
... | import pytest
from pathlib import Path
from blendtorch import btt
BLENDDIR = Path(__file__).parent/'blender'
class MyEnv(btt.env.OpenAIRemoteEnv):
def __init__(self, background=True, **kwargs):
super().__init__(version='1.0.0')
self.launch(scene=BLENDDIR/'env.blend', script=BLENDDIR /
... | en | 0.925615 | # For Blender 2.9 if we pass scene='', the tests below fail since # _env_post_step() is not called. Its unclear currently why this happens. # 1 is already set by reset() | 1.927711 | 2 |
sitetree/__init__.py | sitkatech/django-sitetree | 3 | 6048 | VERSION = (0, 9, 5)
| VERSION = (0, 9, 5)
| none | 1 | 1.195019 | 1 | |
deepvariant/runtime_by_region_vis.py | tahashmi/deepvariant | 4 | 6049 | <filename>deepvariant/runtime_by_region_vis.py
# Copyright 2020 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | <filename>deepvariant/runtime_by_region_vis.py
# Copyright 2020 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | en | 0.777663 | # Copyright 2020 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #... | 1.420834 | 1 |
pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_nd_fields.py | wangyum/anaconda | 0 | 6050 | <filename>pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_nd_fields.py
import sys
import unittest
from dynd import nd, ndt
"""
class TestFields(unittest.TestCase):
def test_simple(self):
a = nd.array([
(1, 2, 'a', 'b'),
(3, 4, 'ab', 'cd'),
... | <filename>pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_nd_fields.py
import sys
import unittest
from dynd import nd, ndt
"""
class TestFields(unittest.TestCase):
def test_simple(self):
a = nd.array([
(1, 2, 'a', 'b'),
(3, 4, 'ab', 'cd'),
... | en | 0.227053 | class TestFields(unittest.TestCase): def test_simple(self): a = nd.array([ (1, 2, 'a', 'b'), (3, 4, 'ab', 'cd'), (5, 6, 'def', 'ghi')], type='3 * {x: int32, y: int32, z: string, w: string}') # Selecting a single field b = nd.fie... | 3.004999 | 3 |
xeofs/pandas/_transformer.py | nicrie/xeofs | 3 | 6051 | from typing import Union, Iterable, List
import numpy as np
import pandas as pd
from ..models._transformer import _ArrayTransformer, _MultiArrayTransformer
class _DataFrameTransformer(_ArrayTransformer):
'''`_ArrayTransformer` wrapper for `pandas.DataFrame`.
'''
def __init__(self):
super().__in... | from typing import Union, Iterable, List
import numpy as np
import pandas as pd
from ..models._transformer import _ArrayTransformer, _MultiArrayTransformer
class _DataFrameTransformer(_ArrayTransformer):
'''`_ArrayTransformer` wrapper for `pandas.DataFrame`.
'''
def __init__(self):
super().__in... | en | 0.41546 | `_ArrayTransformer` wrapper for `pandas.DataFrame`. # Set sample and feature index # Fit the data | 2.862083 | 3 |
tests/bogus_python_model.py | FossilizedContainers/fossilized-controller | 1 | 6052 | <filename>tests/bogus_python_model.py
import os
import sys
import lipd
# import pythonAdapter, assumes in ../python-adapter/
tests_dir = os.path.dirname(os.path.realpath(__file__))
fc_dir = os.path.dirname(tests_dir)
python_adapter_dir = os.path.join(fc_dir, "python-adapter")
sys.path.append(python_adapter_dir)
impor... | <filename>tests/bogus_python_model.py
import os
import sys
import lipd
# import pythonAdapter, assumes in ../python-adapter/
tests_dir = os.path.dirname(os.path.realpath(__file__))
fc_dir = os.path.dirname(tests_dir)
python_adapter_dir = os.path.join(fc_dir, "python-adapter")
sys.path.append(python_adapter_dir)
impor... | en | 0.881795 | # import pythonAdapter, assumes in ../python-adapter/ # check to see inside function # the parameters are handed to you by the adapter # use the parameters given by the adapter to get the binary data of the LiPD file # get the binary data of the NetCDF file # mark the NetCDF file as an output file # have to call adapte... | 2.464087 | 2 |
tello_control_ui.py | banne2266/UAV-autopilot-NCTU-2021 | 0 | 6053 | from PIL import Image
from PIL import ImageTk
import tkinter as tki
from tkinter import Toplevel, Scale
import threading
import datetime
import cv2
import os
import time
import platform
class TelloUI:
"""Wrapper class to enable the GUI."""
def __init__(self,tello,outputpath):
"""
Initial all t... | from PIL import Image
from PIL import ImageTk
import tkinter as tki
from tkinter import Toplevel, Scale
import threading
import datetime
import cv2
import os
import time
import platform
class TelloUI:
"""Wrapper class to enable the GUI."""
def __init__(self,tello,outputpath):
"""
Initial all t... | en | 0.831929 | Wrapper class to enable the GUI. Initial all the element of the GUI,support by Tkinter :param tello: class interacts with the Tello drone. Raises: RuntimeError: If the Tello rejects the attempt to enter command mode. # videostream device # the path that save pictures created by clicking th... | 2.935422 | 3 |
__temp/examples/rhino/mesh-stanford-dragon.py | robin-gdwl/examples_topop-desc | 0 | 6054 | <reponame>robin-gdwl/examples_topop-desc
import compas
import compas_rhino
from compas.datastructures import Mesh
mesh = Mesh.from_ply(compas.get('stanford_dragon.ply'))
compas_rhino.mesh_draw(mesh)
| import compas
import compas_rhino
from compas.datastructures import Mesh
mesh = Mesh.from_ply(compas.get('stanford_dragon.ply'))
compas_rhino.mesh_draw(mesh) | none | 1 | 1.673351 | 2 | |
Python/ML_DL/DL/Neural-Networks-Demystified-master/partOne.py | vbsteja/code | 3 | 6055 | # Neural Networks Demystified
# Part 1: Data + Architecture
#
# Supporting code for short YouTube series on artificial neural networks.
#
# <NAME>
# @stephencwelch
import numpy as np
# X = (hours sleeping, hours studying), y = Score on test
X = np.array(([3,5], [5,1], [10,2]), dtype=float)
y = np.array(([75], [82], [... | # Neural Networks Demystified
# Part 1: Data + Architecture
#
# Supporting code for short YouTube series on artificial neural networks.
#
# <NAME>
# @stephencwelch
import numpy as np
# X = (hours sleeping, hours studying), y = Score on test
X = np.array(([3,5], [5,1], [10,2]), dtype=float)
y = np.array(([75], [82], [... | en | 0.792623 | # Neural Networks Demystified # Part 1: Data + Architecture # # Supporting code for short YouTube series on artificial neural networks. # # <NAME> # @stephencwelch # X = (hours sleeping, hours studying), y = Score on test # Normalize #Max test score is 100 | 3.774004 | 4 |
manubot/process/util.py | benstear/manubot | 0 | 6056 | <gh_stars>0
import json
import logging
import os
import pathlib
import re
import textwrap
import warnings
from typing import List, Optional
import jinja2
import pandas
import requests
import requests_cache
import yaml
from manubot.util import read_serialized_data, read_serialized_dict
from manubot.process.bibliograph... | import json
import logging
import os
import pathlib
import re
import textwrap
import warnings
from typing import List, Optional
import jinja2
import pandas
import requests
import requests_cache
import yaml
from manubot.util import read_serialized_data, read_serialized_dict
from manubot.process.bibliography import loa... | en | 0.598901 | Check for short_citekey hash collisions Identify different citation strings referring the the same reference. \ {len(citekeys_df)} unique citations strings extracted from text {citekeys_df.standard_citekey.nunique()} unique standard citations\ Read multiple serialized data files into a user_variables dictionary... | 2.270164 | 2 |
iba_scrape.py | wmwilcox/mix-mind | 1 | 6057 | <gh_stars>1-10
#! /usr/bin/env python
# scrape the IBA pages for cocktail lists
import sys
import xml.etree.ElementTree as ET
from lxml import html
import requests
from pprint import pprint
from collections import OrderedDict
import json
url = 'http://iba-world.com/new-era-drinks/'
jsonfile = 'IBA_new_era_drinks.jso... | #! /usr/bin/env python
# scrape the IBA pages for cocktail lists
import sys
import xml.etree.ElementTree as ET
from lxml import html
import requests
from pprint import pprint
from collections import OrderedDict
import json
url = 'http://iba-world.com/new-era-drinks/'
jsonfile = 'IBA_new_era_drinks.json'
url = 'http... | en | 0.535292 | #! /usr/bin/env python # scrape the IBA pages for cocktail lists # bar spoon # Get full description from the link # super hax | 2.832984 | 3 |
Data Structures/Tree.py | Royals-Aeo-Gamer/MyPyMods | 0 | 6058 | class TreeNode:
def __init__(self, name, data, parent=None):
self.name = name
self.parent = parent
self.data = data
self.childs = {}
def add_child(self, name, data):
self.childs.update({name:(type(self))(name, data, self)})
def rm_branch(self, name, ansistors_n: lis... | class TreeNode:
def __init__(self, name, data, parent=None):
self.name = name
self.parent = parent
self.data = data
self.childs = {}
def add_child(self, name, data):
self.childs.update({name:(type(self))(name, data, self)})
def rm_branch(self, name, ansistors_n: lis... | none | 1 | 3.137127 | 3 | |
config.py | ggiaquin16/GroupProject19 | 0 | 6059 | api_key = "<KEY>"
mongo_url = 'mongodb://localhost:27017'
mongo_db = 'CarPopularity'
mongo_collections = ['CarSalesByYear', 'PopularCarsByRegion']
years_data = ['2019', '2018', '2017', '2016', '2015']
test_mode = True | api_key = "<KEY>"
mongo_url = 'mongodb://localhost:27017'
mongo_db = 'CarPopularity'
mongo_collections = ['CarSalesByYear', 'PopularCarsByRegion']
years_data = ['2019', '2018', '2017', '2016', '2015']
test_mode = True | none | 1 | 1.70378 | 2 | |
pytorch_ares/pytorch_ares/attack_torch/mim.py | thu-ml/realsafe | 107 | 6060 | <gh_stars>100-1000
import imp
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from pytorch_ares.attack_torch.utils import loss_adv
class MIM(object):
'''Projected Gradient Descent'''
def __init__(self, net, epsilon, p, stepsize, steps, decay_factor, data_name,target, loss... | import imp
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from pytorch_ares.attack_torch.utils import loss_adv
class MIM(object):
'''Projected Gradient Descent'''
def __init__(self, net, epsilon, p, stepsize, steps, decay_factor, data_name,target, loss, device):
... | en | 0.72806 | Projected Gradient Descent # PGD to get adversarial example # clone the advimage as the next iteration input # project the disturbed image to feasible set if needed #cifar10(-1,1) | 2.55462 | 3 |
src/utils/templatetags/menubutton.py | pwelzel/bornhack-website | 0 | 6061 | from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def menubuttonclass(context, appname):
if appname == context['request'].resolver_match.func.view_class.__module__.split(".")[0]:
return "btn-primary"
else:
return "btn-default"
| from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def menubuttonclass(context, appname):
if appname == context['request'].resolver_match.func.view_class.__module__.split(".")[0]:
return "btn-primary"
else:
return "btn-default"
| none | 1 | 1.924751 | 2 | |
wiki/tests.py | Prones94/Make_Wiki | 0 | 6062 | <reponame>Prones94/Make_Wiki
from django.test import TestCase
from django.contrib.auth.models import User
from wiki.models import Page
from django.utils.text import slugify
# Create your tests here.
class WikiPageTest(TestCase):
def test_edit(self):
user = User.objects.create_user(username='admin', passwo... | from django.test import TestCase
from django.contrib.auth.models import User
from wiki.models import Page
from django.utils.text import slugify
# Create your tests here.
class WikiPageTest(TestCase):
def test_edit(self):
user = User.objects.create_user(username='admin', password='<PASSWORD>')
self... | en | 0.684151 | # Create your tests here. Steps to writing a test 1. Set up your test data 2. Make a request (GET, POST) 3a. Check if response matches what we expect 3b. Check if database matches what we expect | 2.539151 | 3 |
birdy/__init__.py | tkiapril/birdy | 1 | 6063 | __author__ = '<NAME> <<EMAIL>>'
__version__ = '0.2'
| __author__ = '<NAME> <<EMAIL>>'
__version__ = '0.2'
| none | 1 | 1.026027 | 1 | |
ares/defense/randomization.py | KuanKuanQAQ/ares | 206 | 6064 | <reponame>KuanKuanQAQ/ares<gh_stars>100-1000
''' The randomization defense method, which applies random . '''
import tensorflow as tf
from ares.defense.input_transformation import input_transformation
def randomize(xs, scale_min=0.875, pad_value=0.0):
''' Apply random rescaling and padding to xs.
:param xs... | ''' The randomization defense method, which applies random . '''
import tensorflow as tf
from ares.defense.input_transformation import input_transformation
def randomize(xs, scale_min=0.875, pad_value=0.0):
''' Apply random rescaling and padding to xs.
:param xs: A batch of inputs for some classifier.
... | en | 0.613234 | The randomization defense method, which applies random . Apply random rescaling and padding to xs. :param xs: A batch of inputs for some classifier. :param scale_min: The random rescaling rate would be chosen between ``scale_min`` and 1.0. :param pad_value: ``constant_values`` parameter for the ``tf.pad`` ... | 3.263394 | 3 |
annotate/backend/admin.py | hopeogbons/image-annotation | 0 | 6065 | <gh_stars>0
from django.contrib import admin
from annotate.backend.models import Image, Annotation
admin.site.register(Image)
admin.site.register(Annotation)
| from django.contrib import admin
from annotate.backend.models import Image, Annotation
admin.site.register(Image)
admin.site.register(Annotation) | none | 1 | 1.377772 | 1 | |
34. Find First and Last Position of Element in Sorted Array/main.py | Competitive-Programmers-Community/LeetCode | 2 | 6066 | class Solution:
def searchRange(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
if not nums:
return [-1, -1]
low = 0
high = len(nums) - 1
f = 0
while low<=high:
mid = (low+h... | class Solution:
def searchRange(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
if not nums:
return [-1, -1]
low = 0
high = len(nums) - 1
f = 0
while low<=high:
mid = (low+h... | en | 0.219431 | :type nums: List[int] :type target: int :rtype: List[int] | 3.345744 | 3 |
c/create.py | LMS57/domato | 0 | 6067 | <gh_stars>0
data = open('./original').readlines()
alphabet = {
"<":"lt",
">":"gt",
"=":"=",
"-":'-',
"+":"+",
"-":"-",
"~":"~",
"!":"ex",
"%":"%",
"^":"^",
"&":"&",
"*":"*",
"(":"(",
")":"right_paran",
... | data = open('./original').readlines()
alphabet = {
"<":"lt",
">":"gt",
"=":"=",
"-":'-',
"+":"+",
"-":"-",
"~":"~",
"!":"ex",
"%":"%",
"^":"^",
"&":"&",
"*":"*",
"(":"(",
")":"right_paran",
"[":"[",... | en | 0.243976 | #item declaration or end | 3.014107 | 3 |
AppServer/google/appengine/api/memcache/memcache_distributed.py | isabella232/scale-safe | 3 | 6068 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.772978 | #!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 1.98879 | 2 |
inflateutils/exportmesh.py | arpruss/inflatemesh | 8 | 6069 | <filename>inflateutils/exportmesh.py
from struct import pack
from .vector import *
from .formatdecimal import decimal
from numbers import Number
import os
import sys
try:
basestring
except:
basestring = str
def isColorTriangleList(polys):
return isinstance(polys[0][1][0][0], Number)
def toPolyhedra(... | <filename>inflateutils/exportmesh.py
from struct import pack
from .vector import *
from .formatdecimal import decimal
from numbers import Number
import os
import sys
try:
basestring
except:
basestring = str
def isColorTriangleList(polys):
return isinstance(polys[0][1][0][0], Number)
def toPolyhedra(... | en | 0.600695 | INPUT: polys: list of (color,polyhedra) pairs (counterclockwise triangles), or a list of (color,triangle) pairs (TODO: currently uses first color for all in latter case) moduleName: OpenSCAD module name OUTPUT: string with OpenSCAD code implementing the polys filename: filename to write OpenSCAD file ... | 2.78827 | 3 |
Assignment1/Identification/match_module.py | arywatt/FDS_2020_2021 | 0 | 6070 | import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import histogram_module
import dist_module
def rgb2gray(rgb):
r, g, b = rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
return gray
# model_images - list of file names of model images
# query_... | import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import histogram_module
import dist_module
def rgb2gray(rgb):
r, g, b = rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
return gray
# model_images - list of file names of model images
# query_... | en | 0.724743 | # model_images - list of file names of model images # query_images - list of file names of query images # # dist_type - string which specifies distance type: 'chi2', 'l2', 'intersect' # hist_type - string which specifies histogram type: 'grayvalue', 'dxdy', 'rgb', 'rg' # # note: use functions 'get_dist_by_name', 'get... | 2.982748 | 3 |
dycco/__main__.py | rojalator/dycco | 0 | 6071 | <reponame>rojalator/dycco<filename>dycco/__main__.py
import argparse
import logging
import sys
from .dycco import document
def main(paths, output_dir, use_ascii:bool, escape_html:bool, single_file:bool):
try:
document(paths, output_dir, use_ascii, escape_html, single_file)
except IOError as e:
... | import argparse
import logging
import sys
from .dycco import document
def main(paths, output_dir, use_ascii:bool, escape_html:bool, single_file:bool):
try:
document(paths, output_dir, use_ascii, escape_html, single_file)
except IOError as e:
logging.error('Unable to open file: %s', e)
... | none | 1 | 2.774239 | 3 | |
jumpy/jumpy/ndarray.py | rghwer/testdocs | 13,006 | 6072 | ################################################################################
# Copyright (c) 2015-2018 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless... | ################################################################################
# Copyright (c) 2015-2018 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless... | en | 0.610529 | ################################################################################ # Copyright (c) 2015-2018 Skymind, Inc. # # This program and the accompanying materials are made available under the # terms of the Apache License, Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0. # # Unless... | 1.974902 | 2 |
Python/usec_mode.py | hanayik/StimSync | 6 | 6073 | import serial
ser = serial.Serial('/dev/tty.usbmodem7071', 115200, timeout=10)
ser.write("\xb1\xa3\xb5\xb5") #set usec mode 177,163,181,181
ser.flush()
ser.flushInput()
obs = ser.read(8)
if len(obs) != 8:
print('Error: no buttons presses detected')
print 'Observed data (as hex): '+ obs.encode('hex')
obsBin = [ord(... | import serial
ser = serial.Serial('/dev/tty.usbmodem7071', 115200, timeout=10)
ser.write("\xb1\xa3\xb5\xb5") #set usec mode 177,163,181,181
ser.flush()
ser.flushInput()
obs = ser.read(8)
if len(obs) != 8:
print('Error: no buttons presses detected')
print 'Observed data (as hex): '+ obs.encode('hex')
obsBin = [ord(... | en | 0.546252 | #set usec mode 177,163,181,181 #turn off oscilloscope: set keyboard mode 177,163,169,169 | 2.528159 | 3 |
torchaudio/datasets/libritts.py | hahaxun/audio | 1 | 6074 | import os
from typing import Tuple
import torchaudio
from torch import Tensor
from torch.utils.data import Dataset
from torchaudio.datasets.utils import (
download_url,
extract_archive,
walk_files,
)
URL = "train-clean-100"
FOLDER_IN_ARCHIVE = "LibriTTS"
_CHECKSUMS = {
"http://www.openslr.org/60/dev-c... | import os
from typing import Tuple
import torchaudio
from torch import Tensor
from torch.utils.data import Dataset
from torchaudio.datasets.utils import (
download_url,
extract_archive,
walk_files,
)
URL = "train-clean-100"
FOLDER_IN_ARCHIVE = "LibriTTS"
_CHECKSUMS = {
"http://www.openslr.org/60/dev-c... | en | 0.583259 | # Load audio # Load original text # Load normalized text Create a Dataset for LibriTTS. Args: root (str): Path to the directory where the dataset is found or downloaded. url (str, optional): The URL to download the dataset from, or the type of the dataset to dowload. Allowed... | 2.348552 | 2 |
Others/Source/19/19.2/barh_test.py | silence0201/Learn-Python | 1 | 6075 | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee <EMAIL> #
# #
# version 1.0 ... | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee <EMAIL> #
# #
# version 1.0 ... | zh | 0.377273 | # coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee <EMAIL> # # # # version 1.0 ... | 2.570831 | 3 |
03_docker_compose/03_c_simple_case_with_mongodb_orm/app/app.py | kendny/study_docker | 2 | 6076 | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 18 20:13:57 2018
@author: allen
"""
import random, os, json, datetime, time
from flask import Flask, Response
from pymongo import MongoClient
from bson import json_util
app = Flask(__name__)
MONGO_URI = "mongodb://mongodb:27017" ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 18 20:13:57 2018
@author: allen
"""
import random, os, json, datetime, time
from flask import Flask, Response
from pymongo import MongoClient
from bson import json_util
app = Flask(__name__)
MONGO_URI = "mongodb://mongodb:27017" # "mongodb:<con... | en | 0.386015 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Tue Dec 18 20:13:57 2018 @author: allen # "mongodb:<container_name>:27017" # hack for the mongoDb database to get running ###################### ## ########################## # Connect to MongoDB and call the connection "my-app". #User('<EMAIL>', name, 'Ross').... | 3.224542 | 3 |
goethe/eval/analogy_space.py | HPI-DeepLearning/wort2vek | 4 | 6077 | #! /usr/bin/Python
from gensim.models.keyedvectors import KeyedVectors
from scipy import spatial
from numpy import linalg
import argparse
import sys
vector_file = sys.argv[1]
if len(sys.argv) != 6:
print('arguments wrong!')
print(len(sys.argv))
exit()
else:
words = [sys.argv[2], sys.argv[3], sys.arg... | #! /usr/bin/Python
from gensim.models.keyedvectors import KeyedVectors
from scipy import spatial
from numpy import linalg
import argparse
import sys
vector_file = sys.argv[1]
if len(sys.argv) != 6:
print('arguments wrong!')
print(len(sys.argv))
exit()
else:
words = [sys.argv[2], sys.argv[3], sys.arg... | en | 0.189799 | #! /usr/bin/Python #print(wvs.most_similar(positive=[words[1], words[2]], negative=[words[0]], topn=3)) | 2.568406 | 3 |
localgraphclustering/algorithms/eig2_nL.py | vishalbelsare/LocalGraphClustering | 106 | 6078 | import numpy as np
import scipy as sp
import scipy.sparse.linalg as splinalg
def eig2_nL(g, tol_eigs = 1.0e-6, normalize:bool = True, dim:int=1):
"""
DESCRIPTION
-----------
Computes the eigenvector that corresponds to the second smallest eigenvalue
of the normalized Laplacian matrix ... | import numpy as np
import scipy as sp
import scipy.sparse.linalg as splinalg
def eig2_nL(g, tol_eigs = 1.0e-6, normalize:bool = True, dim:int=1):
"""
DESCRIPTION
-----------
Computes the eigenvector that corresponds to the second smallest eigenvalue
of the normalized Laplacian matrix ... | en | 0.710163 | DESCRIPTION ----------- Computes the eigenvector that corresponds to the second smallest eigenvalue of the normalized Laplacian matrix then it uses sweep cut to round the solution. PARAMETERS (mandatory) ---------------------- g: graph object PARAMETERS (opti... | 2.673579 | 3 |
build/common/hex2carray.py | isabella232/nanos-nonsecure-firmware | 16 | 6079 | <gh_stars>10-100
"""
*******************************************************************************
* Ledger Blue
* (c) 2016 Ledger
*
* 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
*
*... | """
*******************************************************************************
* Ledger Blue
* (c) 2016 Ledger
*
* 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.... | en | 0.74796 | ******************************************************************************* * Ledger Blue * (c) 2016 Ledger * * 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.apac... | 2.499144 | 2 |
setup.py | xames3/vdoxa | 1 | 6080 | # Copyright 2020 XAMES3. 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 agree... | # Copyright 2020 XAMES3. 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 agree... | en | 0.848863 | # Copyright 2020 XAMES3. 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 agree... | 1.698426 | 2 |
application/modules/login.py | BaggerFast/Simple_votings | 0 | 6081 | <gh_stars>0
from django.contrib import messages
from django.contrib.auth import login, authenticate
from django.shortcuts import render, redirect
from django.urls import reverse
from django.views import View
from application.forms import AuthenticateForm
from application.views import get_navbar, Page
class LoginView... | from django.contrib import messages
from django.contrib.auth import login, authenticate
from django.shortcuts import render, redirect
from django.urls import reverse
from django.views import View
from application.forms import AuthenticateForm
from application.views import get_navbar, Page
class LoginView(View):
... | none | 1 | 2.285516 | 2 | |
little_questions/utils/log.py | HelloChatterbox/little_questions | 0 | 6082 | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | en | 0.687961 | # Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin... | 2.440567 | 2 |
alipay/aop/api/response/AlipayOpenMiniVersionAuditApplyResponse.py | antopen/alipay-sdk-python-all | 0 | 6083 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenMiniVersionAuditApplyResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenMiniVersionAuditApplyResponse, self).__init__()
self._speed_up = None
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenMiniVersionAuditApplyResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenMiniVersionAuditApplyResponse, self).__init__()
self._speed_up = None
... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.034604 | 2 |
cvstudio/view/widgets/loading_dialog/loading_dialog.py | haruiz/PytorchCvStudio | 32 | 6084 | <filename>cvstudio/view/widgets/loading_dialog/loading_dialog.py
import os
from PyQt5 import QtCore
from PyQt5.QtCore import QRect, QPoint
from PyQt5.QtGui import QMovie, QCloseEvent, QShowEvent
from PyQt5.QtWidgets import QDialog, QLabel, QVBoxLayout, QApplication, QWidget
class QLoadingDialog(QDialog):
def __i... | <filename>cvstudio/view/widgets/loading_dialog/loading_dialog.py
import os
from PyQt5 import QtCore
from PyQt5.QtCore import QRect, QPoint
from PyQt5.QtGui import QMovie, QCloseEvent, QShowEvent
from PyQt5.QtWidgets import QDialog, QLabel, QVBoxLayout, QApplication, QWidget
class QLoadingDialog(QDialog):
def __i... | en | 0.270447 | # self.setWindowOpacity(0.8) # dialogGeometry : QRect = self.geometry() | 2.335756 | 2 |
pysnmp-with-texts/MWORKS-MIB.py | agustinhenze/mibs.snmplabs.com | 8 | 6085 | #
# PySNMP MIB module MWORKS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MWORKS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:16:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | #
# PySNMP MIB module MWORKS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MWORKS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:16:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | en | 0.482061 | # # PySNMP MIB module MWORKS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MWORKS-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:16:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 1.547145 | 2 |
Assets/Editor/PostprocessBuildPlayer_MpireNxusMeasurementPostBuildiOS.py | mpire-nxus/nxus_unity_sdk | 1 | 6086 | #!/usr/bin/env python
import sys
import re
from subprocess import Popen, PIPE
import argparse
from pbxproj import XcodeProject, TreeType
from pbxproj import FileOptions
def main():
parser = argparse.ArgumentParser(description="MpireNxusMeasurement post build iOS script")
parser.add_argument('ios_project_path... | #!/usr/bin/env python
import sys
import re
from subprocess import Popen, PIPE
import argparse
from pbxproj import XcodeProject, TreeType
from pbxproj import FileOptions
def main():
parser = argparse.ArgumentParser(description="MpireNxusMeasurement post build iOS script")
parser.add_argument('ios_project_path... | en | 0.616388 | #!/usr/bin/env python # Log function with file injected. # Path of the Xcode SDK on the system. # Path for unity iOS Xcode project and framework on the system. # Edit the Xcode project using mod_pbxproj: # - Add the adSupport framework library. # - Add the iAd framework library. # - Change the compilation flags of t... | 2.167955 | 2 |
vars_in_python.py | klyusba/python-quiz | 0 | 6087 | <filename>vars_in_python.py<gh_stars>0
# == 1 ==
bar = [1, 2]
def foo(bar):
bar = sum(bar)
return bar
print(foo(bar))
# == 2 ==
bar = [1, 2]
def foo(bar):
bar[0] = 1
return sum(bar)
print(foo(bar))
# == 3 ==
bar = [1, 2]
def foo():
bar = sum(bar)
return bar
print(foo())
# == 4 =... | <filename>vars_in_python.py<gh_stars>0
# == 1 ==
bar = [1, 2]
def foo(bar):
bar = sum(bar)
return bar
print(foo(bar))
# == 2 ==
bar = [1, 2]
def foo(bar):
bar[0] = 1
return sum(bar)
print(foo(bar))
# == 3 ==
bar = [1, 2]
def foo():
bar = sum(bar)
return bar
print(foo())
# == 4 =... | ceb | 0.380755 | # == 1 == # == 2 == # == 3 == # == 4 == # == 5 == # == 6 == # == 7 == # == 8 == # == 9 == # == 10 == # == 11 == # == 12 == # == 13 == | 3.619929 | 4 |
hack/dev/gh-replay-events.py | sm43/pipelines-as-code | 0 | 6088 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | en | 0.673351 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir... | 2.142287 | 2 |
nintendeals/noa/api/__init__.py | Pooroomoo/nintendeals | 37 | 6089 | <gh_stars>10-100
from .algolia import search_by_nsuid
from .algolia import search_by_platform
from .algolia import search_by_query
| from .algolia import search_by_nsuid
from .algolia import search_by_platform
from .algolia import search_by_query | none | 1 | 1.092874 | 1 | |
076_Minimum_Window_Substring.py | joshlyman/Josh-LeetCode | 0 | 6090 |
# Other solution
# V2
def minWindow(s, t):
need = collections.Counter(t) #hash table to store char frequency
missing = len(t) #total number of chars we care
start, end = 0, 0
i = 0
for j, char in enumerate(s, 1): #index j from 1
if need[char] > 0... |
# Other solution
# V2
def minWindow(s, t):
need = collections.Counter(t) #hash table to store char frequency
missing = len(t) #total number of chars we care
start, end = 0, 0
i = 0
for j, char in enumerate(s, 1): #index j from 1
if need[char] > 0... | en | 0.89887 | # Other solution # V2 #hash table to store char frequency #total number of chars we care #index j from 1 #match all chars #remove chars to find the real start #make sure the first appearing char satisfies need[char]>0 #we missed this first char, so add missing by 1 #update window #update i to start+1 for next window # ... | 3.372269 | 3 |
home/migrations/0002_auto_20171017_0412.py | Taywee/amberherbert.com | 0 | 6091 | <filename>home/migrations/0002_auto_20171017_0412.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-17 04:12
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
... | <filename>home/migrations/0002_auto_20171017_0412.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-17 04:12
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
... | en | 0.755291 | # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-17 04:12 | 1.752352 | 2 |
lib/adv_model.py | chawins/entangle-rep | 15 | 6092 | import torch
import torch.nn as nn
import torch.nn.functional as F
class PGDModel(nn.Module):
"""
code adapted from
https://github.com/karandwivedi42/adversarial/blob/master/main.py
"""
def __init__(self, basic_net, config):
super(PGDModel, self).__init__()
self.basic_net = basic_... | import torch
import torch.nn as nn
import torch.nn.functional as F
class PGDModel(nn.Module):
"""
code adapted from
https://github.com/karandwivedi42/adversarial/blob/master/main.py
"""
def __init__(self, basic_net, config):
super(PGDModel, self).__init__()
self.basic_net = basic_... | en | 0.746585 | code adapted from https://github.com/karandwivedi42/adversarial/blob/master/main.py code adapted from https://github.com/karandwivedi42/adversarial/blob/master/main.py | 2.716021 | 3 |
fs_image/rpm/storage/tests/storage_base_test.py | singhaditya28/fs_image | 0 | 6093 | <filename>fs_image/rpm/storage/tests/storage_base_test.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch, MagicMock
f... | <filename>fs_image/rpm/storage/tests/storage_base_test.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch, MagicMock
f... | en | 0.910995 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Module import to ensure we get plugins # To make testing more meaningful, it's useful to make sure that # some writes ... | 2.0486 | 2 |
sdk/python/pulumi_gcp/kms/get_kms_crypto_key_version.py | sisisin/pulumi-gcp | 0 | 6094 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | en | 0.599361 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** A collection of values returned by getKMSCryptoKeyVersion. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports. The provid... | 1.938981 | 2 |
lecture11/subsets.py | nd-cse-30872-fa20/cse-30872-fa20-examples | 0 | 6095 | #!/usr/bin/env python3
import itertools
# Constants
NUMBERS = range(0, 10)
# Main Execution
def main():
count = 0
for length in range(0, len(NUMBERS) + 1):
for subset in itertools.combinations(NUMBERS, length):
if sum(subset) % 3 == 0:
count += 1
print(count)
if __... | #!/usr/bin/env python3
import itertools
# Constants
NUMBERS = range(0, 10)
# Main Execution
def main():
count = 0
for length in range(0, len(NUMBERS) + 1):
for subset in itertools.combinations(NUMBERS, length):
if sum(subset) % 3 == 0:
count += 1
print(count)
if __... | en | 0.310872 | #!/usr/bin/env python3 # Constants # Main Execution | 3.716873 | 4 |
src/toil/batchSystems/abstractBatchSystem.py | Hexotical/toil | 348 | 6096 | <reponame>Hexotical/toil<gh_stars>100-1000
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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/lice... | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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... | en | 0.882235 | # Copyright (C) 2015-2021 Regents of the University of California # # 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... | 1.811223 | 2 |
demo/other_demo.py | Heartfilia/lite_tools | 5 | 6097 | # -*- coding: utf-8 -*-
from lite_tools import get_md5, get_sha, get_sha3, get_b64e, get_b64d
# about hashlib ==> get_md5, get_sha, get_sha3 || default mode=256
s = "test_information" # 这里只能丢字符串
print(get_md5(s)) # 5414ffd88fcb58417e64ecec51bb3a6b
print(get_md5(s, upper=True)) # 5414FFD88FCB5841... | # -*- coding: utf-8 -*-
from lite_tools import get_md5, get_sha, get_sha3, get_b64e, get_b64d
# about hashlib ==> get_md5, get_sha, get_sha3 || default mode=256
s = "test_information" # 这里只能丢字符串
print(get_md5(s)) # 5414ffd88fcb58417e64ecec51bb3a6b
print(get_md5(s, upper=True)) # 5414FFD88FCB5841... | en | 0.231973 | # -*- coding: utf-8 -*- # about hashlib ==> get_md5, get_sha, get_sha3 || default mode=256 # 这里只能丢字符串 # 5414ffd88fcb58417e64ecec51bb3a6b # 5414FFD88FCB58417E64ECEC51BB3A6B # b'T\x14\xff\xd8\x8f\xcbXA~d\xec\xecQ\xbb:k' # 转成二进制的需求没什么用但是可以保留 # d09869fdf901465c8566f0e2debfa3f6a3d878a8157e199c7c4c6dd755617f33 # b'\xd0\x9... | 1.71467 | 2 |
prereise/gather/solardata/tests/__init__.py | terrywqf/PreREISE | 0 | 6098 | __all__ = ["mock_pv_info", "test_pv_tracking"]
| __all__ = ["mock_pv_info", "test_pv_tracking"]
| none | 1 | 0.977601 | 1 | |
arfit/cp_utils.py | farr/arfit | 5 | 6099 | <reponame>farr/arfit<filename>arfit/cp_utils.py
import carmcmc as cm
from gatspy.periodic import LombScargleFast
import matplotlib.pyplot as plt
import numpy as np
def csample_from_files(datafile, chainfile, p, q):
data = np.loadtxt(datafile)
times, tind = np.unique(data[:,0], return_index=True)
data = da... | import carmcmc as cm
from gatspy.periodic import LombScargleFast
import matplotlib.pyplot as plt
import numpy as np
def csample_from_files(datafile, chainfile, p, q):
data = np.loadtxt(datafile)
times, tind = np.unique(data[:,0], return_index=True)
data = data[tind, :]
chain = np.loadtxt(chainfil... | none | 1 | 1.979141 | 2 |