hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae1ca49c239339e1313fd11e5b2b7338210ad025 | 179 | py | Python | tests/test_exercise04.py | surajwate/57-python-exercises | 3b47c096266fec114300b9340cd852088a00d56e | [
"MIT"
] | null | null | null | tests/test_exercise04.py | surajwate/57-python-exercises | 3b47c096266fec114300b9340cd852088a00d56e | [
"MIT"
] | 1 | 2021-07-06T17:34:59.000Z | 2021-07-06T17:34:59.000Z | tests/test_exercise04.py | surajwate/57-python-exercises | 3b47c096266fec114300b9340cd852088a00d56e | [
"MIT"
] | null | null | null | from exercises import exercise04
def test_exercise04():
assert exercise04.madlib('dog', 'walk', 'quickly', 'blue') == "Do you walk your blue dog quickly? That's hilarious!"
| 29.833333 | 120 | 0.715084 | 24 | 179 | 5.291667 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039474 | 0.150838 | 179 | 5 | 121 | 35.8 | 0.796053 | 0 | 0 | 0 | 0 | 0 | 0.391061 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.333333 | true | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
ae68ee3c16b75d8ab49c4afc4c51a752db912e96 | 17 | py | Python | hello-world.py | IrvingHerreraLuna/profiles-rest-api | ffa5801c9588035033c6ee493b918486cc5d6001 | [
"MIT"
] | null | null | null | hello-world.py | IrvingHerreraLuna/profiles-rest-api | ffa5801c9588035033c6ee493b918486cc5d6001 | [
"MIT"
] | null | null | null | hello-world.py | IrvingHerreraLuna/profiles-rest-api | ffa5801c9588035033c6ee493b918486cc5d6001 | [
"MIT"
] | null | null | null | print('helowwww') | 17 | 17 | 0.764706 | 2 | 17 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 1 | 17 | 17 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
ae6aecb8947b2a5f5353cbf64c1f2c3e7f217336 | 641,636 | py | Python | Corona_visualization.py | Vaibhhh/Corona-Virus-Visualisation | 1698ac5ac154e49dd83e000250ddc3fdc2814cc0 | [
"MIT"
] | null | null | null | Corona_visualization.py | Vaibhhh/Corona-Virus-Visualisation | 1698ac5ac154e49dd83e000250ddc3fdc2814cc0 | [
"MIT"
] | null | null | null | Corona_visualization.py | Vaibhhh/Corona-Virus-Visualisation | 1698ac5ac154e49dd83e000250ddc3fdc2814cc0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Covid-19 Data Visualization using Plotly Express (50 graphs)
#
#
# ### For Fast Processing :Go to runtime(headbar)> Change runtime type > GPU
# ## Task 1: Importing Necessary Libraries
# Importing Pandas and Matplotlib
# In[ ]:
import pandas as pd #Data analysis and Manipulation
import matplotlib.pyplot as plt #Data Visualization
# Importing Plotly
# In[ ]:
import plotly.offline as py
py.init_notebook_mode(connected=True)
import plotly.graph_objs as go # Importing Plotly
import plotly.express as px
# Initializing Plotly (#Plotly Consumes a lot of computing power, so its default mode is off in Google Colab, Hence we need to initialize it)
# In[ ]:
import plotly.io as pio
pio.renderers.default = 'colab' # To initialize plotly
# ### Task 2: Importing the Datasets
# In[ ]:
from google.colab import files
files.upload()
# In[ ]:
df1= pd.read_csv("covid.csv")
df1.head()
# In[ ]:
from google.colab import files
files.upload()
# In[ ]:
df2= pd.read_csv("covid_grouped.csv")
df2.head()
# In[ ]:
df2.tail()
# Dataset 1 and Dataset 2 Columns
# In[ ]:
df1.columns
# In[ ]:
df1.drop(['NewCases','NewDeaths', 'NewRecovered'], axis=1, inplace=True)
# In[ ]:
df1.head()
# Creating Tables
# In[ ]:
from plotly.figure_factory import create_table
table=create_table(df1.head(10), colorscale="blues")
py.iplot(table)
# ### Task 3: Quick Visualizations with Custom Bar Charts
# In[ ]:
#dataset 1, x,y,color,height,hover_data
df1.columns
# Total Cases vs Countries
# In[ ]:
px.bar(df1.head(10), x='Country/Region', y='TotalCases', color='Country/Region', height=500, hover_data=['Country/Region', 'Continent'])
# Total Death vs Countries
# In[ ]:
px.bar(df1.head(10), x='Country/Region', y='TotalDeaths', color='Country/Region', height=500, hover_data=['Country/Region', 'Continent'])
# Total Recovered vs Countries
# In[ ]:
px.bar(df1.head(10), x='Country/Region', y='TotalRecovered', color='TotalRecovered', height=500, hover_data=['Country/Region', 'Continent'])
# Total Tests vs Countries (Orientation)
# In[ ]:
px.bar(df1.head(10), x='TotalTests', y='Country/Region', color='TotalTests', orientation="h",height=500, hover_data=['Country/Region', 'Continent'])
# In[ ]:
px.bar(df1.head(10), x='TotalTests', y='Continent', color='TotalTests', orientation="h",height=500, hover_data=['Country/Region', 'Continent'])
# ## Task 4: Data Visualization using Bubble Chart
# In[ ]:
# px.scatter, x,y, size, color, hover_data, size_max, log_x,log_y
df1.columns
# Total Cases vs Continent (50 countries)
# In[ ]:
px.scatter(df1, x='Continent',y='TotalCases', hover_data=['Country/Region', 'Continent'],
color='TotalCases', size='TotalCases', size_max=80)
# In[ ]:
px.scatter(df1.head(57), x='Continent',y='TotalCases', hover_data=['Country/Region', 'Continent'],
color='TotalCases', size='TotalCases', size_max=80, log_y=True)
# Total Tests vs Continent (50 countries)
# In[ ]:
px.scatter(df1.head(54), x='Continent',y='TotalTests', hover_data=['Country/Region', 'Continent'],
color='TotalTests', size='TotalTests', size_max=80)
# In[ ]:
px.scatter(df1.head(50), x='Continent',y='TotalTests', hover_data=['Country/Region', 'Continent'],
color='TotalTests', size='TotalTests', size_max=80, log_y=True)
# Total Deaths vs Continent (20 countries)
# In[ ]:
px.scatter(df1.head(50), x='Continent',y='TotalDeaths', hover_data=['Country/Region', 'Continent'],
color='TotalDeaths', size='TotalDeaths', size_max=80, log_y=True)
# Total Cases vs Countries (All Countries)
# In[ ]:
# In[ ]:
px.scatter(df1.head(100), x='Country/Region', y='TotalCases', hover_data=['Country/Region', 'Continent'],
color='TotalCases', size='TotalCases', size_max=80)
# Total Cases vs Countries (Top 30)
# In[ ]:
px.scatter(df1.head(30), x='Country/Region', y='TotalCases', hover_data=['Country/Region', 'Continent'],
color='Country/Region', size='TotalCases', size_max=80, log_y=True)
# In[ ]:
df1.columns
# Total death vs Countries (Top 10)
# In[ ]:
px.scatter(df1.head(10), x='Country/Region', y= 'TotalDeaths', hover_data=['Country/Region', 'Continent'],
color='Country/Region', size= 'TotalDeaths', size_max=80)
# Total Tests/1M vs Countries (Top 50)
# In[ ]:
px.scatter(df1.head(30), x='Country/Region', y= 'Tests/1M pop', hover_data=['Country/Region', 'Continent'],
color='Country/Region', size= 'Tests/1M pop', size_max=80)
# In[ ]:
px.scatter(df1.head(30), x='Country/Region', y= 'Tests/1M pop', hover_data=['Country/Region', 'Continent'],
color='Tests/1M pop', size= 'Tests/1M pop', size_max=80)
# In[ ]:
df1.columns
# Total case vs Total death
# In[ ]:
px.scatter(df1.head(30), x='TotalCases', y= 'TotalDeaths', hover_data=['Country/Region', 'Continent'],
color='TotalDeaths', size= 'TotalDeaths', size_max=80)
# In[ ]:
px.scatter(df1.head(30), x='TotalCases', y= 'TotalDeaths', hover_data=['Country/Region', 'Continent'],
color='TotalDeaths', size= 'TotalDeaths', size_max=80, log_x=True, log_y=True)
# Total test vs Total cases
# In[ ]:
px.scatter(df1.head(30), x='TotalTests', y= 'TotalCases', hover_data=['Country/Region', 'Continent'],
color='TotalTests', size= 'TotalTests', size_max=80, log_x=True, log_y=True)
# ## Advanced Data Visualization using Line graph & Bar graph (Dataset 2)
# In[ ]:
# This Dataset contains DATE column which makes it more appropriate for more advanced Data Visualization
# In[ ]:
df2.columns
# In[ ]:
df2.head()
# In[ ]:
df2.tail()
# Date Vs Confirmed (All Countries)
# In[ ]:
px.bar(df2, x="Date", y="Confirmed", color="Confirmed", hover_data=["Confirmed", "Date", "Country/Region"], height=400)
# In[ ]:
px.bar(df2, x="Date", y="Confirmed", color="Confirmed", hover_data=["Confirmed", "Date", "Country/Region"],log_y=True, height=400)
# Date vs Death (All countries)[Line Graph]
# In[ ]:
px.bar(df2, x="Date", y="Deaths", color="Deaths", hover_data=["Confirmed", "Date", "Country/Region"],log_y=False, height=400)
# In[ ]:
df_US= df2.loc[df2["Country/Region"]=="US"]
# Date Vs Confirmed (US)
# In[ ]:
px.bar(df_US, x="Date", y="Confirmed", color="Confirmed", height=400)
# Date vs Recovered (US)
# In[ ]:
px.bar(df_US,x="Date", y="Recovered", color="Recovered", height=400)
# Date vs Death (US)
# In[ ]:
px.line(df_US,x="Date", y="Recovered", height=400)
# In[ ]:
px.line(df_US,x="Date", y="Deaths", height=400)
# In[ ]:
px.line(df_US,x="Date", y="Confirmed", height=400)
# Date vs New Cases (US)[Line graph]
# In[ ]:
px.line(df_US,x="Date", y="New cases", height=400)
# In[ ]:
px.bar(df_US,x="Date", y="New cases", height=400)
# Date Vs New cases (India) [Line graph]
# In[ ]:
df_india= df2.loc[df2["Country/Region"]== "India"]
# In[ ]:
px.bar(df_india, x="Date", y="New cases", height=400)
# In[ ]:
px.line(df_india, x="Date", y="New cases", height=400)
# Date Vs Confirmed (India)
# In[ ]:
px.bar(df_india, x="Date", y="Confirmed", height=400)
# Date Vs New Death (India)
# In[ ]:
px.bar(df_india, x="Date", y="Deaths", height=400)
# In[ ]:
px.bar(df_india, x="Date", y="New deaths", height=400)
# In[ ]:
px.bar(df_india, x="Date", y="Recovered", height=400)
# In[ ]:
px.bar(df_india, x="Date", y="New recovered", height=400)
# In[ ]:
px.scatter(df_US, x="Confirmed", y="Deaths", height=400)
# In[ ]:
px.scatter(df_india, x="Confirmed", y="New cases", height=400)
# # Task 6: Represent Geographic Data as Choropleth Maps
#
#
# In[ ]:
# A choropleth map displays divided geographical areas or regions that are coloured, shaded or patterned in relation to a data variable.
#Dataset 2
#parameters= dataset, locations= ISOALPHA, color, hover_name, color_continuous_scale= [RdYlGn, Blues, Viridis...], animation_frame= Date
#Amazing Representation of data in a map . Choropleth maps provide an easy way to visualize how a measurement varies across a geographic area.
# 
# Equi-rectangular Projection: Total cases
# In[ ]:
px.choropleth(df2,
locations="iso_alpha",
color="Confirmed",
hover_name="Country/Region",
color_continuous_scale="Blues",
animation_frame="Date")
# In[ ]:
# In[ ]:
px.choropleth(df2,
locations='iso_alpha',
color="Deaths",
hover_name="Country/Region",
color_continuous_scale="Viridis",
animation_frame="Date" )
# Orthographic Projection : Total Death
# In[ ]:
px.choropleth(df2,
locations='iso_alpha',
color="Deaths",
hover_name="Country/Region",
color_continuous_scale="Viridis",
projection="orthographic",
animation_frame="Date" )
# Equirectangular Projection : Total Recovered
# In[ ]:
px.choropleth(df2,
locations='iso_alpha',
color="Recovered",
hover_name="Country/Region",
color_continuous_scale="RdYlGn",
projection="natural earth",
animation_frame="Date" )
# In[ ]:
# ## Task 7: Animations
# In[ ]:
#px.bar (data, x,y, color, hover_name, animation_frame)
#px.scatter (data, x,y, color, hover_name, animation_frame, size, size_max)
# Bar Animation : Total Cases
# In[ ]:
px.bar(df2, x="WHO Region", y="Confirmed", color="WHO Region", animation_frame="Date", hover_name="Country/Region")
# Bar Animation : New cases
# In[ ]:
px.bar(df2, x="WHO Region", y="New cases", color="WHO Region", animation_frame="Date", hover_name="Country/Region")
# In[ ]:
# ## Bonus Lecture : WordCloud (Reasons of Death) (New dataset-3)
# In[ ]:
#Step 1. Importing WordCloud and datasets
#Step 2. Exploring data using pandas #NEW DATASET 3
#Step 3. Creating WordCloud
# In[ ]:
#Step3a= Convert the column with diseases count into list using tolist() function
#Step3b= Convert the list to one single string
#Step3x= Convert the string into WordCloud
# 
# In[ ]:
from wordcloud import WordCloud
# In[ ]:
from google.colab import files
files.upload()
# In[ ]:
df3= pd.read_csv("covid death.csv")
df3.head()
# In[ ]:
df3.tail()
# In[ ]:
# In[ ]:
df3.groupby(["Condition"]).count()
# In[ ]:
df3.groupby(["Condition Group"]).count()
# In[ ]:
#Step 3 : WordCloud 1
#Step3a= Convert the column with diseases count into list using tolist() function
# In[ ]:
sentences= df3["Condition"].tolist()
# In[ ]:
#Step3b= Convert the list to one single string
# In[ ]:
sentences_as_a_string= ' '.join(sentences)
# In[ ]:
#Step3c= Convert the string into WordCloud
# In[ ]:
plt.figure(figsize=(14,14))
plt.imshow(WordCloud().generate(sentences_as_a_string))
# In[ ]:
#Step 3 : WordCloud 2- "Condition Group" column
#Step3a= Convert the column with diseases count into list using tolist() function
# In[ ]:
column2_tolist= df3["Condition Group"].tolist()
# In[ ]:
#Step3b= Convert the list to one single string
# In[ ]:
column_to_string= " ".join(column2_tolist)
# In[ ]:
#Step3c= Convert the string into WordCloud
# In[ ]:
plt.figure(figsize=(20,20))
plt.imshow(WordCloud().generate(column_to_string))
# In[ ]:
| 893.643454 | 518,501 | 0.963066 | 20,052 | 641,636 | 30.810692 | 0.893178 | 0.000291 | 0.000227 | 0.000641 | 0.010325 | 0.00978 | 0.009597 | 0.008506 | 0.005139 | 0.004035 | 0 | 0.151603 | 0.003363 | 641,636 | 717 | 518,502 | 894.889819 | 0.814522 | 0.988133 | 0 | 0.333333 | 0 | 0 | 0.267763 | 0 | 0 | 1 | 0 | 0.001395 | 0 | 1 | 0 | false | 0 | 0.087302 | 0 | 0.087302 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
ae7af19b727ccc7719e45fec3f83e5fb7c745a79 | 106 | py | Python | venv/Lib/site-packages/xero_python/project/api/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 77 | 2020-02-16T03:50:18.000Z | 2022-03-11T03:53:26.000Z | venv/Lib/site-packages/xero_python/project/api/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 50 | 2020-04-06T10:15:52.000Z | 2022-03-29T21:27:50.000Z | venv/Lib/site-packages/xero_python/project/api/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 27 | 2020-06-04T11:16:17.000Z | 2022-03-19T06:27:36.000Z | # flake8: noqa
# import apis into api package
from xero_python.project.api.project_api import ProjectApi
| 21.2 | 58 | 0.811321 | 16 | 106 | 5.25 | 0.75 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.132075 | 106 | 4 | 59 | 26.5 | 0.902174 | 0.386792 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
ae8b02e75e3e2431dce918964b704561b1548a1d | 1,976 | py | Python | tests/test_benchmark.py | dumpmemory/doubtlab | e9802b3f64e42961bff79ae1368d3c0a3d81a3a8 | [
"MIT"
] | 300 | 2021-11-05T21:10:50.000Z | 2022-03-30T04:59:02.000Z | tests/test_benchmark.py | dumpmemory/doubtlab | e9802b3f64e42961bff79ae1368d3c0a3d81a3a8 | [
"MIT"
] | 24 | 2021-11-09T15:28:30.000Z | 2022-03-25T12:13:48.000Z | tests/test_benchmark.py | dumpmemory/doubtlab | e9802b3f64e42961bff79ae1368d3c0a3d81a3a8 | [
"MIT"
] | 18 | 2021-11-13T10:17:37.000Z | 2022-03-30T19:25:42.000Z | import pytest
import numpy as np
from doubtlab.benchmark import shuffle_labels, flip_labels
@pytest.mark.parametrize("n", [100, 200, 500, 1000])
def test_flip_labels_n(n):
"""Test some basic properties."""
y = ["pos", "neg", "neu"] * 1000
y_out, indicator = flip_labels(y, n=n)
assert indicator.sum() == n
flipped = (y != y_out).astype(np.int8)
assert np.all(flipped == indicator)
@pytest.mark.parametrize("p", [0.1, 0.2, 0.3, 0.5])
def test_flip_labels_p(p):
"""Test some basic properties."""
y = ["pos", "neg", "neu"] * 1000
y_out, indicator = flip_labels(y, p=p)
flipped = (y != y_out).astype(np.int8)
assert np.all(flipped == indicator)
@pytest.mark.parametrize("n", [100, 200, 500, 1000])
def test_shuffle_labels_n(n):
"""Test some basic properties."""
y = np.random.normal(0, 1, 10000)
y_out, indicator = shuffle_labels(y, n=n)
assert indicator.sum() == n
flipped = (y != y_out).astype(np.int8)
assert np.all(flipped == indicator)
@pytest.mark.parametrize("p", [0.1, 0.2, 0.3, 0.5])
def test_shuffle_labels_p(p):
"""Test some basic properties."""
y = np.random.normal(0, 1, 10000)
y_out, indicator = shuffle_labels(y, p=p)
flipped = (y != y_out).astype(np.int8)
assert np.all(flipped == indicator)
def test_raise_error_bad_n():
"""If n == 1 then we can't really shuffle so we raise an error."""
with pytest.raises(ValueError):
y = np.random.normal(0, 1, 10000)
shuffle_labels(y, n=1)
def test_raise_error_no_n_or_p():
"""Gotta make sure one of the values is given."""
with pytest.raises(ValueError):
y = np.random.normal(0, 1, 10000)
shuffle_labels(y, n=1)
def test_raise_error_bad_p_value():
"""Probability values should be 0 < p < 1."""
y = np.random.normal(0, 1, 10000)
with pytest.raises(ValueError):
shuffle_labels(y, p=1.5)
with pytest.raises(ValueError):
shuffle_labels(y, p=0.0)
| 29.939394 | 70 | 0.638158 | 316 | 1,976 | 3.848101 | 0.231013 | 0.096217 | 0.069079 | 0.061678 | 0.818257 | 0.799342 | 0.799342 | 0.78125 | 0.6875 | 0.6875 | 0 | 0.061986 | 0.199899 | 1,976 | 65 | 71 | 30.4 | 0.707147 | 0.129555 | 0 | 0.627907 | 0 | 0 | 0.013064 | 0 | 0 | 0 | 0 | 0 | 0.139535 | 1 | 0.162791 | false | 0 | 0.069767 | 0 | 0.232558 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
ae90a21f754b7ab45d4d159363616110d8e9ff4c | 44 | py | Python | test/login.py | 811633267/infomation21 | 2e42c56a229a2813367ea39b94162df4f3ed7c5c | [
"MIT"
] | null | null | null | test/login.py | 811633267/infomation21 | 2e42c56a229a2813367ea39b94162df4f3ed7c5c | [
"MIT"
] | null | null | null | test/login.py | 811633267/infomation21 | 2e42c56a229a2813367ea39b94162df4f3ed7c5c | [
"MIT"
] | null | null | null | num1 = 10
num2 = 20
num3 = 30
num4 = 8888
| 6.285714 | 11 | 0.590909 | 8 | 44 | 3.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | 0.318182 | 44 | 6 | 12 | 7.333333 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
ae9cf05a1a3f958481f62e8a4dc8576be9f19c73 | 117 | py | Python | backend/app/schemas/user.py | flsworld/comment-rick-n-morty | fdab96ca5d14fedd2428fbdad7e49ec8e31b4ddd | [
"MIT"
] | null | null | null | backend/app/schemas/user.py | flsworld/comment-rick-n-morty | fdab96ca5d14fedd2428fbdad7e49ec8e31b4ddd | [
"MIT"
] | null | null | null | backend/app/schemas/user.py | flsworld/comment-rick-n-morty | fdab96ca5d14fedd2428fbdad7e49ec8e31b4ddd | [
"MIT"
] | null | null | null | from pydantic import BaseModel
class UserSchema(BaseModel):
name: str
class UserCreate(UserSchema):
pass
| 11.7 | 30 | 0.74359 | 13 | 117 | 6.692308 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.196581 | 117 | 9 | 31 | 13 | 0.925532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.2 | 0.2 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
8825ee16438c72e94b44572e34c155dd1b4a8214 | 4,484 | py | Python | naoqi_proxy_python_classes/PackageManager.py | FabianGroeger96/hslu-roblab-hs18 | 60fca783609f04dee785a96356646a586a63b768 | [
"MIT"
] | null | null | null | naoqi_proxy_python_classes/PackageManager.py | FabianGroeger96/hslu-roblab-hs18 | 60fca783609f04dee785a96356646a586a63b768 | [
"MIT"
] | null | null | null | naoqi_proxy_python_classes/PackageManager.py | FabianGroeger96/hslu-roblab-hs18 | 60fca783609f04dee785a96356646a586a63b768 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Class autogenerated from /home/sam/Downloads/aldebaran_sw/nao/naoqi-sdk-2.1.4.13-linux64/include/alproxies/packagemanagerproxy.h
# by Sammy Pfeiffer's <Sammy.Pfeiffer at student.uts.edu.au> generator
# You need an ALBroker running
from naoqi import ALProxy
class PackageManager(object):
def __init__(self, session):
self.proxy = None
self.session = session
def force_connect(self):
self.proxy = self.session.service("PackageManager")
def getPackage(self, arg1):
"""
:param str arg1: arg
:returns AL::ALValue:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.getPackage(arg1)
def getPackageIcon(self, arg1):
"""
:param str arg1: arg
:returns AL::ALValue:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.getPackageIcon(arg1)
def getPackages(self):
"""
:returns AL::ALValue:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.getPackages()
def hasPackage(self, arg1):
"""
:param str arg1: arg
:returns bool:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.hasPackage(arg1)
def install(self, arg1):
"""
:param str arg1: arg
:returns bool:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.install(arg1)
def install2(self, arg1, arg2):
"""
:param str arg1: arg
:param str arg2: arg
:returns int:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.install(arg1, arg2)
def install3(self, arg1, arg2, arg3):
"""
:param str arg1: arg
:param str arg2: arg
:param str arg3: arg
:returns int:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.install(arg1, arg2, arg3)
def installCheckMd5(self, arg1, arg2):
"""
:param str arg1: arg
:param str arg2: arg
:returns bool:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.installCheckMd5(arg1, arg2)
def package(self, arg1):
"""
:param str arg1: arg
:returns AL::ALValue:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.package(arg1)
def package2(self, arg1):
"""
:param str arg1: arg
:returns AL::ALValue:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.package2(arg1)
def packageIcon(self, arg1):
"""
:param str arg1: arg
:returns str:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.packageIcon(arg1)
def packages(self):
"""
:returns std::vector<AL::ALValue>:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.packages()
def packages2(self):
"""
:returns std::vector<AL::ALValue>:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.packages2()
def remove(self, arg1):
"""
:param str arg1: arg
:returns int:
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.remove(arg1)
def removePkg(self, arg1):
"""
:param str arg1: arg
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.removePkg(arg1)
def setServiceDirectory(self, arg1):
"""
:param str arg1: arg
"""
if not self.proxy:
self.proxy = self.session.service("PackageManager")
return self.proxy.setServiceDirectory(arg1)
| 25.477273 | 130 | 0.559322 | 481 | 4,484 | 5.201663 | 0.174636 | 0.179856 | 0.171463 | 0.135891 | 0.702238 | 0.702238 | 0.685851 | 0.665867 | 0.653877 | 0.653877 | 0 | 0.021753 | 0.323372 | 4,484 | 175 | 131 | 25.622857 | 0.8029 | 0.200491 | 0 | 0.464789 | 1 | 0 | 0.077348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.253521 | false | 0 | 0.014085 | 0 | 0.507042 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
88606c92147612139146883b1e4b90e84a2cd77c | 50 | py | Python | gym-duckietown/learning/imitation/iil_dagger/teacher/__init__.py | lyf44/CS4278-5478-Project-Materials | 685419c65847e72450e99586e9e0f3794369b4a3 | [
"MIT"
] | 4 | 2020-04-28T15:48:56.000Z | 2020-05-03T14:03:01.000Z | gym-duckietown/learning/imitation/iil_dagger/teacher/__init__.py | lyf44/CS4278-5478-Project-Materials | 685419c65847e72450e99586e9e0f3794369b4a3 | [
"MIT"
] | null | null | null | gym-duckietown/learning/imitation/iil_dagger/teacher/__init__.py | lyf44/CS4278-5478-Project-Materials | 685419c65847e72450e99586e9e0f3794369b4a3 | [
"MIT"
] | 21 | 2020-04-28T16:38:01.000Z | 2021-11-16T14:21:08.000Z | from .pure_pursuit_policy import PurePursuitPolicy | 50 | 50 | 0.92 | 6 | 50 | 7.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06 | 50 | 1 | 50 | 50 | 0.93617 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
ee1dac9578aad5d68b81e49ab7e1dfa4d4b3027b | 78 | py | Python | attic/wpfrontman/wp_frontman/context_processors.py | ludoo/wpkit | 0447d941a438e143b0e51b5e73418a0206832823 | [
"BSD-3-Clause"
] | null | null | null | attic/wpfrontman/wp_frontman/context_processors.py | ludoo/wpkit | 0447d941a438e143b0e51b5e73418a0206832823 | [
"BSD-3-Clause"
] | null | null | null | attic/wpfrontman/wp_frontman/context_processors.py | ludoo/wpkit | 0447d941a438e143b0e51b5e73418a0206832823 | [
"BSD-3-Clause"
] | null | null | null |
def blog(request):
return dict(blog=getattr(request, 'blog', None))
| 15.6 | 53 | 0.641026 | 10 | 78 | 5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205128 | 78 | 4 | 54 | 19.5 | 0.806452 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
ee24f8f045de2b1c4ee4d43417d9bfb2774675f0 | 105 | py | Python | many_requests/__init__.py | 0xflotus/many_requests | dab3963eff471669f7b372cf488a2d9623270fab | [
"MIT"
] | 398 | 2020-11-11T16:04:44.000Z | 2022-01-31T10:49:36.000Z | many_requests/__init__.py | 0xflotus/many_requests | dab3963eff471669f7b372cf488a2d9623270fab | [
"MIT"
] | 6 | 2020-11-12T16:15:50.000Z | 2021-04-01T12:18:34.000Z | many_requests/__init__.py | 0xflotus/many_requests | dab3963eff471669f7b372cf488a2d9623270fab | [
"MIT"
] | 7 | 2020-11-11T17:12:21.000Z | 2020-12-19T23:01:11.000Z | from .easy_async import EasyAsync, delayed, zip_kw
from .many_requests_ import ManyRequests, BadResponse
| 35 | 53 | 0.847619 | 14 | 105 | 6.071429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104762 | 105 | 2 | 54 | 52.5 | 0.904255 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
ee3217400fa98caebd95ba6fb390581305e27b33 | 240 | py | Python | {{cookiecutter.package_title_name}}/{{cookiecutter.package_name}}/emailer/__init__.py | drkostas/starter | fd8d0c16519e418e9479fe2d81643f06dacb125f | [
"MIT"
] | null | null | null | {{cookiecutter.package_title_name}}/{{cookiecutter.package_name}}/emailer/__init__.py | drkostas/starter | fd8d0c16519e418e9479fe2d81643f06dacb125f | [
"MIT"
] | 11 | 2021-02-08T03:57:53.000Z | 2022-01-30T01:03:32.000Z | {{cookiecutter.package_title_name}}/{{cookiecutter.package_name}}/emailer/__init__.py | drkostas/starter | fd8d0c16519e418e9479fe2d81643f06dacb125f | [
"MIT"
] | null | null | null | """Emailer sub-package of {{cookiecutter.package_title_name}}."""
from .gmail_emailer import GmailEmailer
__author__ = "{{cookiecutter.author}}"
__email__ = "{{cookiecutter.author_email}}"
__version__ = "{{cookiecutter.package_version}}"
| 30 | 65 | 0.7625 | 24 | 240 | 6.916667 | 0.583333 | 0.228916 | 0.277108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079167 | 240 | 7 | 66 | 34.285714 | 0.751131 | 0.245833 | 0 | 0 | 0 | 0 | 0.48 | 0.48 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c9e013dad6071cd3fa03056e50e07716e43e5f43 | 114 | py | Python | simulation/simulation/geometry/__init__.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | 2 | 2022-03-09T21:33:46.000Z | 2022-03-12T06:14:41.000Z | simulation/simulation/geometry/__init__.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | null | null | null | simulation/simulation/geometry/__init__.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | null | null | null | from .material import Material
from .model import Model, ModelGroup
__all__ = ['Material', 'Model', 'ModelGroup']
| 28.5 | 45 | 0.754386 | 13 | 114 | 6.307692 | 0.461538 | 0.365854 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122807 | 114 | 3 | 46 | 38 | 0.82 | 0 | 0 | 0 | 0 | 0 | 0.201754 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
14e4e610a7ca3a9262435136fa70801dbee7f777 | 5,350 | py | Python | gcode_gen/tool.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | gcode_gen/tool.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | gcode_gen/tool.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from . import base_types
from . import number
class Tool(base_types.Named):
def __init__(self,
cut_diameter,
cut_height,
shank_diameter=(1 / 8 * number.mm_per_inch),
name=None,
):
super().__init__(name)
self.cut_diameter = cut_diameter
self.shank_diameter = shank_diameter
self.cut_height = cut_height
@property
def default_name(self):
return self.__class__.__name__
class Carbide3D_101(Tool):
def __init__(self,
):
super().__init__(cut_diameter=(1 / 8 * number.mm_per_inch),
cut_height=(0.75 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class Carbide3D_102(Tool):
def __init__(self,
):
super().__init__(cut_diameter=(1 / 8 * number.mm_per_inch),
cut_height=(0.75 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class Carbide3D_112(Tool):
def __init__(self,
):
super().__init__(cut_diameter=(1 / 16 * number.mm_per_inch),
cut_height=(0.25 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_1p2mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=1.2,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_1p1mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=1.1,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_1p0mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=1,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p9mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.9,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p8mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.8,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p7mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.7,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p6mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.6,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p5mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.5,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p4mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.4,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbDrill_0p3mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.3,
cut_height=(0.4 * number.mm_per_inch),
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class InventablesPcbMill_P3_3002(Tool):
def __init__(self,
):
self.cutAngle = 30 * np.pi / 180
shank_diameter = (1 / 8 * number.mm_per_inch)
cut_height = (shank_diameter / 2) / np.tan(self.cutAngle / 2)
super().__init__(cut_diameter=0.2,
cut_height=cut_height,
shank_diameter=shank_diameter,
)
class Mill_0p5mm(Tool):
def __init__(self,
):
super().__init__(cut_diameter=0.5,
cut_height=(0.25 * number.mm_per_inch), # FIXME?
shank_diameter=(1 / 8 * number.mm_per_inch),
)
class Mill_0p01mm(Tool): # not for real! For testing extreme cases
def __init__(self,
):
super().__init__(cut_diameter=0.01,
cut_height=(0.25 * number.mm_per_inch), # FIXME?
shank_diameter=(1 / 8 * number.mm_per_inch),
)
| 31.470588 | 74 | 0.492336 | 561 | 5,350 | 4.167558 | 0.130125 | 0.11976 | 0.164671 | 0.224551 | 0.778015 | 0.769033 | 0.769033 | 0.762618 | 0.728828 | 0.558597 | 0 | 0.047724 | 0.408598 | 5,350 | 169 | 75 | 31.656805 | 0.691214 | 0.009907 | 0 | 0.522727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005917 | 0 | 1 | 0.136364 | false | 0 | 0.022727 | 0.007576 | 0.295455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
11a7e75578235abf09b35e59daeeb4bb9b51115e | 40 | py | Python | src/kgmk/dsa/dp/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/dsa/dp/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/dsa/dp/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | import sys
sys.setrecursionlimit(10**6) | 20 | 28 | 0.8 | 6 | 40 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.081081 | 0.075 | 40 | 2 | 28 | 20 | 0.783784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
11f446ee927ffaf51493b2923bb47b2f89062416 | 195 | py | Python | src/nba_anomaly_generator/data/__init__.py | eliavw/nba-anomaly-generator | a1e162095b76a3406411925093381e9ace9258c7 | [
"MIT"
] | null | null | null | src/nba_anomaly_generator/data/__init__.py | eliavw/nba-anomaly-generator | a1e162095b76a3406411925093381e9ace9258c7 | [
"MIT"
] | null | null | null | src/nba_anomaly_generator/data/__init__.py | eliavw/nba-anomaly-generator | a1e162095b76a3406411925093381e9ace9258c7 | [
"MIT"
] | null | null | null | from .collect import (
get_default_team_plyr_stats_dataframe,
get_plyr_stats_dataframe,
get_team_plyr_stats_dataframe,
get_team_roster_dataframe,
)
from .datasets import load_lal
| 24.375 | 42 | 0.810256 | 27 | 195 | 5.259259 | 0.481481 | 0.190141 | 0.380282 | 0.443662 | 0.528169 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148718 | 195 | 7 | 43 | 27.857143 | 0.855422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
eeb04b7ead45386f79ebfa901a196d7f512edb5c | 141 | py | Python | controle_financeiro/carteiras/admin.py | douglaspands/controle-financeiro | 1f8f44dca6132b730e92ccf62447dede4119b28e | [
"MIT"
] | null | null | null | controle_financeiro/carteiras/admin.py | douglaspands/controle-financeiro | 1f8f44dca6132b730e92ccf62447dede4119b28e | [
"MIT"
] | null | null | null | controle_financeiro/carteiras/admin.py | douglaspands/controle-financeiro | 1f8f44dca6132b730e92ccf62447dede4119b28e | [
"MIT"
] | 1 | 2021-06-15T22:14:22.000Z | 2021-06-15T22:14:22.000Z | from django.contrib import admin
from .models import Carteira, CentroCusto
admin.site.register(Carteira)
admin.site.register(CentroCusto)
| 17.625 | 41 | 0.822695 | 18 | 141 | 6.444444 | 0.555556 | 0.155172 | 0.293103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.099291 | 141 | 7 | 42 | 20.142857 | 0.913386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
eeba94309d78452f5d40b8d4d4b7ac34ae0561b3 | 68 | py | Python | mlsurvey/workflows/__init__.py | jlaumonier/mlsurvey | 373598d067c7f0930ba13fe8da9756ce26eecbaf | [
"MIT"
] | null | null | null | mlsurvey/workflows/__init__.py | jlaumonier/mlsurvey | 373598d067c7f0930ba13fe8da9756ce26eecbaf | [
"MIT"
] | null | null | null | mlsurvey/workflows/__init__.py | jlaumonier/mlsurvey | 373598d067c7f0930ba13fe8da9756ce26eecbaf | [
"MIT"
] | null | null | null | from .learning_workflow import LearningWorkflow
from . import tasks
| 22.666667 | 47 | 0.852941 | 8 | 68 | 7.125 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 68 | 2 | 48 | 34 | 0.95 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0110c7ed1a98c49a9a2b1c5d4989204b94fa1c8f | 92 | py | Python | core/object.py | Salenia/Orca | 1b3381eb22c6c269fa3d6d9c07e997bcc92f1702 | [
"MIT"
] | null | null | null | core/object.py | Salenia/Orca | 1b3381eb22c6c269fa3d6d9c07e997bcc92f1702 | [
"MIT"
] | null | null | null | core/object.py | Salenia/Orca | 1b3381eb22c6c269fa3d6d9c07e997bcc92f1702 | [
"MIT"
] | null | null | null |
class Object(dict):
def __getattr__(self, name):
return self.get(name)
| 10.222222 | 32 | 0.586957 | 11 | 92 | 4.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.304348 | 92 | 9 | 33 | 10.222222 | 0.78125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
014768711917deb07afb22fecbbc62dddd3c5fe3 | 9,387 | py | Python | iotas/device.py | cheshrkat/holideck | 4ee6e11d728ef24c32670e6b15a16de27c8f7406 | [
"MIT"
] | 2 | 2018-01-03T09:58:00.000Z | 2019-05-15T07:26:33.000Z | iotas/device.py | jpwarren/holideck | 4fd39f5cf5bd3a1749d5c57f1a73ea70fd9a8f49 | [
"MIT"
] | null | null | null | iotas/device.py | jpwarren/holideck | 4fd39f5cf5bd3a1749d5c57f1a73ea70fd9a8f49 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
"""
Class implementation for devices for Holiday by MooresCloud
Right now we understand four different classes of devices:
GPIO by Linux
Light by MooresCloud
Holiday by MooresCloud
EngineRoom Chippendale by MooresCloud
Hue by Philips
WeMo by Belkin
Homepage and documentation: http://dev.moorescloud.com/
Copyright (c) 2013, Mark Pesce.
License: MIT (see LICENSE for details)
"""
__author__ = 'Mark Pesce'
__version__ = '0.01-dev'
__license__ = 'MIT'
import urllib2, json, socket, os.path, os, subprocess, math, time
class GPIO:
def __init__(self, number, direction):
"""The GPIO port number is passed as number,
The direction is a boolean, where True = out, False = in"""
self.number = number
self.base = "/sys/class/gpio/gpio%s/" % number
self.create()
self.direction = direction # True = out, False = in
self.set_direction(self.direction)
#print self.base
return
def get_info(self):
resp= {}
resp['device_type'] = 'gpio'
resp['num'] = self.number
resp['direction'] = self.get_direction()
resp['value'] = self.value()
return resp
def create(self):
"""Instance the GPIO port in the OS.
If it already exists, don't do anything."""
if os.path.exists("/sys/class/gpio/gpio%s" % self.number):
return
else:
f = open("/sys/class/gpio/export", "w")
f.write("%s" % self.number)
f.close()
def get_direction(self):
dirname = self.base + "direction"
f = open(dirname, "r")
d = f.read()
d = d[:-1] # Remove line feed thingy maybe
#print "Direction is %s" % d
if (d == "in"):
return False
else:
return True
def set_direction(self, inout):
dirname = self.base + "direction"
f = open(dirname, "w")
if inout == True:
f.write("out")
else:
f.write("in")
f.close()
self.direction = inout
def on(self):
"""Raises error if direction is not out"""
if self.direction == True:
dirname = self.base + "value"
f = open(dirname, "w")
f.write("1")
f.close()
#cmd = """echo "1" > %s""" % dirname
#print cmd
#os.system(cmd)
else:
raise Error("Invalid direction")
return
def off(self):
"""Raises error if direction is not out"""
if self.direction == True:
dirname = self.base + "value"
f = open(dirname, "w")
f.write("0")
f.close()
else:
raise Error("Invalid direction")
return
def value(self):
dirname = self.base + "value"
fd = open(dirname, "r")
val = fd.read()
fd.close()
#print "value read is %s" % val
if val[:1] == "1":
return True
else:
return False
class Holiday:
def __init__(self, address):
self.address = address
self.numleds = 50
self.pipename = "/run/pipelights.fifo"
self.leds = [] # Array of LED values. This may actually exist elsewhere eventually.
try:
self.pipe = open(self.pipename,"w+")
except:
print "Couldn't open the pipe, there's gonna be trouble!"
ln = 0
while (ln < self.numleds):
self.leds.append([0x00, 0x00, 0x00]) # Create and clear an array of RGB LED values
ln = ln + 1
return
def get_devices(self):
l = { "device_type": "Holiday", "number": 50, "version": 0.1 }
return [ l ]
def get_led_value(self, lednum):
if lednum < self.numleds:
return self.leds[lednum]
else:
raise IndexError("Illegal LED number")
def set_led_value(self, lednum, value):
if lednum < self.numleds:
self.leds[lednum][0] = value[0]
self.leds[lednum][1] = value[1]
self.leds[lednum][2] = value[2]
self.render()
#print self.leds
return self.leds[lednum]
else:
raise IndexError("Illegal LED number")
def get_light_values(self):
return { "lights": self.leds }
def set_light_values(self, value):
ln = 0
while (ln < self.numleds):
self.leds[ln][0] = value[0] # White please
self.leds[ln][1] = value[1]
self.leds[ln][2] = value[2]
ln = ln + 1
self.render()
return { "lights": self.leds }
def do_setvalues(self, values):
ln = 0
while (ln < self.numleds):
self.leds[ln][0] = values[ln][0] # White please
self.leds[ln][1] = values[ln][1]
self.leds[ln][2] = values[ln][2]
ln = ln + 1
self.render()
return { "lights": self.leds }
def gradient(self, begin, end, steps):
"""Do it the new-fashioned way"""
steps = float(steps)
base = [0.0,0.0,0.0]
base[0] = begin[0]
base[1] = begin[1]
base[2] = begin[2]
incr = [0.0,0.0,0.0]
incr[0] = float((end[0]-begin[0]) / steps)
incr[1] = float((end[1]-begin[1]) / steps)
incr[2] = float((end[2]-begin[2]) / steps)
print "r-incr %f g-incr %f b-incr %f" % (incr[0],incr[1],incr[2])
s = 0.0
gr = [0,0,0]
while (s < steps):
gr[0] = int(base[0] + (incr[0] * s))
gr[1] = int(base[1] + (incr[1] * s))
gr[2] = int(base[2] + (incr[2] * s))
self.set_light_values(gr)
s = s + 1
time.sleep(.02)
return { "value": True }
def nrl(self, data):
"""Set the NRL team colours based on the passed value"""
team_num = int(data['team'])
print "team_num %d" % team_num
if (team_num < 1) or (team_num > 16):
return { 'value': False }
try:
resp = subprocess.call(['/home/mpesce/sport/nrl', str(team_num)])
except:
return { 'value': False }
return { 'value': True }
def afl(self, data):
"""Set the NRL team colours based on the passed value"""
team_num = int(data['team'])
if (team_num < 1) or (team_num > 18):
return { 'value': False }
try:
resp = subprocess.call(['/home/mpesce/sport/afl', str(team_num)])
except:
return { 'value': False }
return { 'value': True }
def render(self):
"""Render the LED array to the Light"""
"""This version is safe because it renders to a string in memory"""
echo = ""
ln = 0
while (ln < self.numleds):
tripval = (self.leds[ln][0] * 65536) + (self.leds[ln][1] * 256) + self.leds[ln][2]
#echo = echo + "%6X" % tripval + "\\" + "\\" + "x0a" # magic pixie formatting eh?
echo = echo + "%6X\n" % tripval
ln = ln+1
#print echo
#os.system("""%s""" % echo)
self.pipe.write(echo)
self.pipe.flush()
#os.system("""%s | /srv/http/cgi-bin/setlights""" % echo)
return
def on(self):
return set_light_values([255,255,255])
def off(self):
return set_light_values([0,0,0])
class EngineRoom:
def __init__(self, address):
self.address = address
self.numleds = 96
self.pipename = "/run/pipelights.fifo"
self.leds = [] # Array of LED values. This may actually exist elsewhere eventually.
try:
self.pipe = open(self.pipename,"w+")
except:
print "Couldn't open the pipe, there's gonna be trouble!"
ln = 0
while (ln < self.numleds):
self.leds.append([0x00, 0x00, 0x00]) # Create and clear an array of RGB LED values
ln = ln + 1
return
def get_devices(self):
l = { "device_type": "LEDs", "number": 96, "version": 4.1 }
return [ l ]
def get_led_value(self, lednum):
if lednum < self.numleds:
return self.leds[lednum]
else:
raise IndexError("Illegal LED number")
def set_led_value(self, lednum, value):
if lednum < self.numleds:
self.leds[lednum][0] = value[0]
self.leds[lednum][1] = value[1]
self.leds[lednum][2] = value[2]
self.render()
#print self.leds
return self.leds[lednum]
else:
raise IndexError("Illegal LED number")
def get_light_values(self):
return { "lights": self.leds }
def set_light_values(self, value):
ln = 0
while (ln < self.numleds):
self.leds[ln][0] = value[0] # White please
self.leds[ln][1] = value[1]
self.leds[ln][2] = value[2]
ln = ln + 1
self.render()
return { "lights": self.leds }
def do_setvalues(self, values):
ln = 0
while (ln < self.numleds):
self.leds[ln][0] = values[ln][0] # White please
self.leds[ln][1] = values[ln][1]
self.leds[ln][2] = values[ln][2]
ln = ln + 1
self.render()
return { "lights": self.leds }
def gradient(self, begin, end, steps):
"""Do it the new-fashioned way"""
steps = float(steps)
base = [0.0,0.0,0.0]
base[0] = begin[0]
base[1] = begin[1]
base[2] = begin[2]
incr = [0.0,0.0,0.0]
incr[0] = float((end[0]-begin[0]) / steps)
incr[1] = float((end[1]-begin[1]) / steps)
incr[2] = float((end[2]-begin[2]) / steps)
print "r-incr %f g-incr %f b-incr %f" % (incr[0],incr[1],incr[2])
s = 0.0
gr = [0,0,0]
while (s < steps):
gr[0] = int(base[0] + (incr[0] * s))
gr[1] = int(base[1] + (incr[1] * s))
gr[2] = int(base[2] + (incr[2] * s))
self.set_light_values(gr)
s = s + 1
time.sleep(.02)
return { "value": True }
def render(self):
"""Render the LED array to the Light"""
"""This version is safe because it renders to a string in memory"""
echo = ""
ln = 0
while (ln < self.numleds):
tripval = (self.leds[ln][0] * 65536) + (self.leds[ln][1] * 256) + self.leds[ln][2]
#echo = echo + "%6X" % tripval + "\\" + "\\" + "x0a" # magic pixie formatting eh?
echo = echo + "%6X\n" % tripval
ln = ln+1
#print echo
#os.system("""%s""" % echo)
self.pipe.write(echo)
self.pipe.flush()
#os.system("""%s | /srv/http/cgi-bin/setlights""" % echo)
return
def on(self):
return set_light_values([127,127,127])
def off(self):
return set_light_values([0,0,0])
class Device:
def __init__(self, dev):
self.dev = dev
return
def on(self):
self.dev.on()
return
def off(self):
self.dev.off()
return
def value(self):
try:
val = self.dev.value()
except:
raise Error("Method does not exist")
return val
| 25.032 | 87 | 0.614254 | 1,469 | 9,387 | 3.872022 | 0.151123 | 0.056259 | 0.010549 | 0.008439 | 0.73699 | 0.724684 | 0.724684 | 0.691632 | 0.691632 | 0.675105 | 0 | 0.033541 | 0.212315 | 9,387 | 374 | 88 | 25.09893 | 0.735732 | 0.090231 | 0 | 0.782143 | 0 | 0 | 0.094702 | 0.014889 | 0 | 0 | 0.003219 | 0 | 0 | 0 | null | null | 0 | 0.003571 | null | null | 0.017857 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
014b955ec5c76bedfea53e7df84f3fa2086f2e54 | 127 | py | Python | nuodbawsquickstart/__init__.py | nuodb/nuodb-aws-quickstart | 0f98dc6e0e0a9645fd453b9490b02faa959e9a9b | [
"BSD-3-Clause"
] | 2 | 2015-09-29T19:18:16.000Z | 2021-01-19T20:57:49.000Z | nuodbawsquickstart/__init__.py | nuodb/nuodb-aws-quickstart | 0f98dc6e0e0a9645fd453b9490b02faa959e9a9b | [
"BSD-3-Clause"
] | null | null | null | nuodbawsquickstart/__init__.py | nuodb/nuodb-aws-quickstart | 0f98dc6e0e0a9645fd453b9490b02faa959e9a9b | [
"BSD-3-Clause"
] | 1 | 2017-05-17T10:06:57.000Z | 2017-05-17T10:06:57.000Z | from cluster import *
from database import *
from domain import *
from exception import *
from host import *
from zone import * | 21.166667 | 23 | 0.771654 | 18 | 127 | 5.444444 | 0.444444 | 0.510204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181102 | 127 | 6 | 24 | 21.166667 | 0.942308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
6da512a05055827c1fec25446ae2182f43af1305 | 113 | py | Python | 0x04-python-more_data_structures/0-square_matrix_simple.py | BennettDixon/holbertonschool-higher_level_programming | 3fbcd5e009548aab5539ce8610b4113f005964c4 | [
"MIT"
] | 1 | 2022-02-07T12:13:18.000Z | 2022-02-07T12:13:18.000Z | 0x04-python-more_data_structures/0-square_matrix_simple.py | BennettDixon/holbertonschool-higher_level_programming | 3fbcd5e009548aab5539ce8610b4113f005964c4 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/0-square_matrix_simple.py | BennettDixon/holbertonschool-higher_level_programming | 3fbcd5e009548aab5539ce8610b4113f005964c4 | [
"MIT"
] | 1 | 2021-12-06T18:15:54.000Z | 2021-12-06T18:15:54.000Z | #!/usr/bin/python3
def square_matrix_simple(matrix=[]):
return ([[(x**2) for x in row] for row in matrix])
| 18.833333 | 54 | 0.646018 | 19 | 113 | 3.736842 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021277 | 0.168142 | 113 | 5 | 55 | 22.6 | 0.734043 | 0.150442 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
6dc8dd4f775e25c4150e960ecc605ee6553ed52a | 1,324 | py | Python | lib/systems/d-tagatose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/d-tagatose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/d-tagatose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | import pulsar as psr
def load_ref_system():
""" Returns d-tagatose as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C -0.6304 -0.5059 -0.5478
C -2.0218 -0.1222 -0.0130
C -2.5311 -0.9493 1.1576
O -0.6220 -0.5708 -1.9504
H -0.3772 -1.5545 -0.2650
C 0.4542 0.4819 -0.0135
O -2.6570 0.7907 -0.5020
O -3.8939 -0.8179 1.4328
H -1.9263 -0.7042 2.0549
H -2.4178 -2.0295 0.9532
C 1.8808 0.0067 -0.4226
O 0.3352 0.6850 1.3715
H 0.2675 1.5057 -0.4154
H 1.8406 -0.4738 -1.4290
C 2.8453 1.2158 -0.4369
O 2.3194 -1.0530 0.3942
O 4.1867 0.8513 -0.5954
H 2.8474 1.7552 0.5281
H 2.5377 1.9296 -1.2254
H 4.2546 0.3365 -1.3903
H 2.8084 -0.6812 1.1190
H -4.1047 0.1080 1.4526
H -0.9245 0.2665 -2.2834
H 0.4916 -0.1488 1.8009
""")
| 41.375 | 66 | 0.397281 | 198 | 1,324 | 2.641414 | 0.535354 | 0.015296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.544629 | 0.500755 | 1,324 | 31 | 67 | 42.709677 | 0.246596 | 0.080816 | 0 | 0 | 0 | 0 | 0.929825 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.035714 | true | 0 | 0.035714 | 0 | 0.107143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6dcc4e4d711a80d6579ef08451a8182fb7b78bea | 3,466 | py | Python | z2/part3/updated_part2_batch/jm/parser_errors_2/484875673.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part3/updated_part2_batch/jm/parser_errors_2/484875673.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part3/updated_part2_batch/jm/parser_errors_2/484875673.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 484875673
"""
"""
random actions, total chaos
"""
board = gamma_new(4, 5, 4, 5)
assert board is not None
assert gamma_move(board, 1, 0, 1) == 1
assert gamma_free_fields(board, 1) == 19
assert gamma_move(board, 2, 2, 0) == 1
assert gamma_move(board, 3, 0, 1) == 0
assert gamma_free_fields(board, 3) == 18
assert gamma_move(board, 4, 3, 1) == 1
assert gamma_move(board, 4, 0, 2) == 1
assert gamma_move(board, 1, 1, 2) == 1
assert gamma_golden_move(board, 2, 1, 3) == 0
assert gamma_move(board, 3, 0, 1) == 0
assert gamma_move(board, 3, 3, 0) == 1
assert gamma_busy_fields(board, 3) == 1
assert gamma_move(board, 4, 2, 2) == 1
assert gamma_move(board, 1, 3, 3) == 1
assert gamma_free_fields(board, 1) == 12
assert gamma_move(board, 2, 2, 4) == 1
assert gamma_free_fields(board, 2) == 11
assert gamma_move(board, 3, 1, 2) == 0
assert gamma_move(board, 3, 2, 1) == 1
assert gamma_free_fields(board, 3) == 10
assert gamma_move(board, 4, 0, 0) == 1
assert gamma_move(board, 1, 3, 0) == 0
assert gamma_golden_possible(board, 1) == 1
assert gamma_move(board, 2, 4, 1) == 0
assert gamma_move(board, 2, 1, 3) == 1
assert gamma_move(board, 3, 1, 1) == 1
assert gamma_move(board, 3, 1, 2) == 0
assert gamma_move(board, 4, 4, 3) == 0
assert gamma_move(board, 4, 1, 4) == 1
assert gamma_move(board, 1, 3, 2) == 1
assert gamma_move(board, 2, 3, 0) == 0
assert gamma_move(board, 3, 0, 4) == 1
assert gamma_move(board, 3, 3, 4) == 1
assert gamma_move(board, 4, 0, 1) == 0
assert gamma_move(board, 1, 3, 2) == 0
assert gamma_move(board, 2, 0, 1) == 0
assert gamma_busy_fields(board, 2) == 3
board703600597 = gamma_board(board)
assert board703600597 is not None
assert board703600597 == ("3423\n"
".2.1\n"
"4141\n"
"1334\n"
"4.23\n")
del board703600597
board703600597 = None
assert gamma_move(board, 3, 3, 1) == 0
assert gamma_move(board, 3, 2, 4) == 0
assert gamma_move(board, 4, 3, 2) == 0
assert gamma_move(board, 1, 3, 2) == 0
assert gamma_free_fields(board, 1) == 3
assert gamma_move(board, 2, 0, 1) == 0
assert gamma_move(board, 3, 3, 2) == 0
assert gamma_move(board, 4, 2, 1) == 0
assert gamma_move(board, 4, 1, 3) == 0
assert gamma_move(board, 1, 0, 1) == 0
assert gamma_move(board, 1, 2, 2) == 0
assert gamma_move(board, 2, 3, 2) == 0
assert gamma_move(board, 2, 0, 0) == 0
assert gamma_move(board, 3, 1, 1) == 0
assert gamma_move(board, 4, 3, 2) == 0
assert gamma_busy_fields(board, 4) == 5
assert gamma_move(board, 1, 0, 1) == 0
assert gamma_move(board, 1, 0, 1) == 0
board396310819 = gamma_board(board)
assert board396310819 is not None
assert board396310819 == ("3423\n"
".2.1\n"
"4141\n"
"1334\n"
"4.23\n")
del board396310819
board396310819 = None
assert gamma_move(board, 2, 3, 0) == 0
assert gamma_move(board, 2, 2, 1) == 0
assert gamma_golden_possible(board, 2) == 1
assert gamma_move(board, 3, 3, 2) == 0
assert gamma_move(board, 4, 1, 2) == 0
board664249270 = gamma_board(board)
assert board664249270 is not None
assert board664249270 == ("3423\n"
".2.1\n"
"4141\n"
"1334\n"
"4.23\n")
del board664249270
board664249270 = None
assert gamma_busy_fields(board, 3) == 5
assert gamma_move(board, 4, 3, 3) == 0
assert gamma_golden_possible(board, 4) == 1
gamma_delete(board)
| 28.409836 | 46 | 0.669071 | 621 | 3,466 | 3.57971 | 0.072464 | 0.311741 | 0.330634 | 0.440846 | 0.731444 | 0.719298 | 0.515969 | 0.325236 | 0.324336 | 0.306343 | 0 | 0.151494 | 0.179169 | 3,466 | 121 | 47 | 28.644628 | 0.629877 | 0 | 0 | 0.281553 | 0 | 0 | 0.026643 | 0 | 0 | 0 | 0 | 0 | 0.679612 | 1 | 0 | false | 0 | 0.009709 | 0 | 0.009709 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6dd414428a54fd107c573d25ac9dd4fdc9092d61 | 191 | py | Python | server/__init__.py | artaf/ofaudit | 146e92d8880dc4343c488bb06618f38f43937b8b | [
"MIT"
] | null | null | null | server/__init__.py | artaf/ofaudit | 146e92d8880dc4343c488bb06618f38f43937b8b | [
"MIT"
] | null | null | null | server/__init__.py | artaf/ofaudit | 146e92d8880dc4343c488bb06618f38f43937b8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from . import config
from . import db
from . import fields
from . import http
from . import server
from . import templates
from . import wsgi_apps
from . import web
| 15.916667 | 23 | 0.706806 | 28 | 191 | 4.785714 | 0.5 | 0.597015 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006579 | 0.204188 | 191 | 11 | 24 | 17.363636 | 0.875 | 0.109948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
6dd4694b3ef078231a839b9b69d476d59d5f4398 | 23 | py | Python | tardis/util/__init__.py | karban8/tardis | f1ab565ba76a106719ce01088135465cbfdf3191 | [
"BSD-3-Clause"
] | 176 | 2015-02-26T07:26:59.000Z | 2022-03-16T18:26:22.000Z | tardis/util/__init__.py | karban8/tardis | f1ab565ba76a106719ce01088135465cbfdf3191 | [
"BSD-3-Clause"
] | 1,474 | 2015-02-12T13:02:16.000Z | 2022-03-31T09:05:54.000Z | tardis/util/__init__.py | karban8/tardis | f1ab565ba76a106719ce01088135465cbfdf3191 | [
"BSD-3-Clause"
] | 434 | 2015-02-07T17:15:41.000Z | 2022-03-23T04:49:38.000Z | # Utilities for TARDIS
| 11.5 | 22 | 0.782609 | 3 | 23 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 23 | 1 | 23 | 23 | 0.947368 | 0.869565 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6dd652b3df20369223cd27c4cfc6701e4104a87b | 37 | py | Python | t/data/foo/fourthparty/mudule.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | t/data/foo/fourthparty/mudule.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | t/data/foo/fourthparty/mudule.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | class Integration2(object):
pass
| 12.333333 | 27 | 0.72973 | 4 | 37 | 6.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033333 | 0.189189 | 37 | 2 | 28 | 18.5 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
6dde5c16125e8abc99c125ade9b2cecf21d1ec96 | 58 | py | Python | bot/migrators/__init__.py | yukie-nobuharu/TTMediaBot | 9d34aadb1cfa41fcceee212931ff12526d3d137f | [
"MIT"
] | null | null | null | bot/migrators/__init__.py | yukie-nobuharu/TTMediaBot | 9d34aadb1cfa41fcceee212931ff12526d3d137f | [
"MIT"
] | null | null | null | bot/migrators/__init__.py | yukie-nobuharu/TTMediaBot | 9d34aadb1cfa41fcceee212931ff12526d3d137f | [
"MIT"
] | null | null | null | from bot.migrators import cache_migrator, config_migrator
| 29 | 57 | 0.87931 | 8 | 58 | 6.125 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086207 | 58 | 1 | 58 | 58 | 0.924528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
6de3975c420e8b0ecfcbdb37a64a8c6ae8d3bf72 | 95 | py | Python | functions/modules/import_module_alias.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2020-11-02T05:52:33.000Z | 2021-06-09T01:28:22.000Z | functions/modules/import_module_alias.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | null | null | null | functions/modules/import_module_alias.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2021-04-08T05:26:04.000Z | 2021-06-09T01:28:23.000Z | import pizza as piz
piz.make_pizza(12,"extra-cheese")
piz.make_pizza(16,"sausages","tomatoes") | 23.75 | 40 | 0.768421 | 16 | 95 | 4.4375 | 0.6875 | 0.197183 | 0.338028 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044944 | 0.063158 | 95 | 4 | 40 | 23.75 | 0.752809 | 0 | 0 | 0 | 0 | 0 | 0.291667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1117c60d443ff5cc50fb2f273776f603172e394f | 197 | py | Python | test_plugins/ssh_url.py | geerlingguy/ansible-content-testing | 799f948d86fa30944b76b7d120c288b6a571421f | [
"MIT"
] | 5 | 2020-04-14T20:49:02.000Z | 2020-04-29T06:56:57.000Z | test_plugins/ssh_url.py | geerlingguy/ansible-content-testing | 799f948d86fa30944b76b7d120c288b6a571421f | [
"MIT"
] | 11 | 2020-04-13T17:06:32.000Z | 2020-07-20T17:35:09.000Z | test_plugins/ssh_url.py | geerlingguy/ansible-content-testing | 799f948d86fa30944b76b7d120c288b6a571421f | [
"MIT"
] | 1 | 2020-04-27T17:49:17.000Z | 2020-04-27T17:49:17.000Z | from ansible.module_utils.known_hosts import is_ssh_url
def ssh_url_test(url):
return is_ssh_url(url)
class TestModule(object):
def tests(self):
return dict(ssh_url=ssh_url_test)
| 21.888889 | 55 | 0.756345 | 33 | 197 | 4.181818 | 0.575758 | 0.217391 | 0.115942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162437 | 197 | 8 | 56 | 24.625 | 0.836364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.333333 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
1151c758d34201519d6cc6c2d8512e2528eaea1c | 4,008 | py | Python | frame_2D_alg/alternative versions/LUT.py | landdafku11/CogAlg | b33d706b25f63d5a2a4bbf9bb6a5d1fad5b9b5eb | [
"MIT"
] | 102 | 2016-10-09T01:33:00.000Z | 2022-01-28T01:03:23.000Z | frame_2D_alg/alternative versions/LUT.py | Risingabhi/CogAlg | a95ea498af3104893f92028f466a56ef3a211f10 | [
"MIT"
] | 41 | 2017-06-04T16:09:43.000Z | 2022-01-20T21:11:42.000Z | frame_2D_alg/alternative versions/LUT.py | Risingabhi/CogAlg | a95ea498af3104893f92028f466a56ef3a211f10 | [
"MIT"
] | 50 | 2017-05-10T06:25:36.000Z | 2021-08-02T20:28:54.000Z | import numpy as np
TRANSLATING_SLICES = {
0:[
(Ellipsis, slice(None, -2, None), slice(None, -2, None)),
(Ellipsis, slice(None, -2, None), slice(1, -1, None)),
(Ellipsis, slice(None, -2, None), slice(2, None, None)),
(Ellipsis, slice(1, -1, None), slice(2, None, None)),
(Ellipsis, slice(2, None, None), slice(2, None, None)),
(Ellipsis, slice(2, None, None), slice(1, -1, None)),
(Ellipsis, slice(2, None, None), slice(None, -2, None)),
(Ellipsis, slice(1, -1, None), slice(None, -2, None)),
],
1:[
(Ellipsis, slice(None, -4, None), slice(None, -4, None)),
(Ellipsis, slice(None, -4, None), slice(1, -3, None)),
(Ellipsis, slice(None, -4, None), slice(2, -2, None)),
(Ellipsis, slice(None, -4, None), slice(3, -1, None)),
(Ellipsis, slice(None, -4, None), slice(4, None, None)),
(Ellipsis, slice(1, -3, None), slice(4, None, None)),
(Ellipsis, slice(2, -2, None), slice(4, None, None)),
(Ellipsis, slice(3, -1, None), slice(4, None, None)),
(Ellipsis, slice(4, None, None), slice(4, None, None)),
(Ellipsis, slice(4, None, None), slice(3, -1, None)),
(Ellipsis, slice(4, None, None), slice(2, -2, None)),
(Ellipsis, slice(4, None, None), slice(1, -3, None)),
(Ellipsis, slice(4, None, None), slice(None, -4, None)),
(Ellipsis, slice(3, -1, None), slice(None, -4, None)),
(Ellipsis, slice(2, -2, None), slice(None, -4, None)),
(Ellipsis, slice(1, -3, None), slice(None, -4, None)),
],
2:[
(Ellipsis, slice(None, -6, None), slice(None, -6, None)),
(Ellipsis, slice(None, -6, None), slice(1, -5, None)),
(Ellipsis, slice(None, -6, None), slice(2, -4, None)),
(Ellipsis, slice(None, -6, None), slice(3, -3, None)),
(Ellipsis, slice(None, -6, None), slice(4, -2, None)),
(Ellipsis, slice(None, -6, None), slice(5, -1, None)),
(Ellipsis, slice(None, -6, None), slice(6, None, None)),
(Ellipsis, slice(1, -5, None), slice(6, None, None)),
(Ellipsis, slice(2, -4, None), slice(6, None, None)),
(Ellipsis, slice(3, -3, None), slice(6, None, None)),
(Ellipsis, slice(4, -2, None), slice(6, None, None)),
(Ellipsis, slice(5, -1, None), slice(6, None, None)),
(Ellipsis, slice(6, None, None), slice(6, None, None)),
(Ellipsis, slice(6, None, None), slice(5, -1, None)),
(Ellipsis, slice(6, None, None), slice(4, -2, None)),
(Ellipsis, slice(6, None, None), slice(3, -3, None)),
(Ellipsis, slice(6, None, None), slice(2, -4, None)),
(Ellipsis, slice(6, None, None), slice(1, -5, None)),
(Ellipsis, slice(6, None, None), slice(None, -6, None)),
(Ellipsis, slice(5, -1, None), slice(None, -6, None)),
(Ellipsis, slice(4, -2, None), slice(None, -6, None)),
(Ellipsis, slice(3, -3, None), slice(None, -6, None)),
(Ellipsis, slice(2, -4, None), slice(None, -6, None)),
(Ellipsis, slice(1, -5, None), slice(None, -6, None)),
],
}
Y_COEFFS = {
1:np.array([-0.5, -0.5, -0.5, 0. , 0.5, 0.5, 0.5, 0. ]),
2:np.array([-0.25, -0.25, -0.25, -0.25, -0.25, -0.5 , 0. , 0.5 , 0.25,
0.25, 0.25, 0.25, 0.25, 0.5 , 0. , -0.5 ]),
3:np.array([-0.167, -0.167, -0.167, -0.167, -0.167, -0.167, -0.167, -0.25 ,
-0.5 , 0. , 0.5 , 0.25 , 0.167, 0.167, 0.167, 0.167,
0.167, 0.167, 0.167, 0.25 , 0.5 , 0. , -0.5 , -0.25 ]),
}
X_COEFFS = {
1:np.array([-0.5, 0. , 0.5, 0.5, 0.5, 0. , -0.5, -0.5]),
2:np.array([-0.25, -0.5 , 0. , 0.5 , 0.25, 0.25, 0.25, 0.25, 0.25,
0.5 , 0. , -0.5 , -0.25, -0.25, -0.25, -0.25]),
3:np.array([-0.167, -0.25 , -0.5 , 0. , 0.5 , 0.25 , 0.167, 0.167,
0.167, 0.167, 0.167, 0.167, 0.167, 0.25 , 0.5 , 0. ,
-0.5 , -0.25 , -0.167, -0.167, -0.167, -0.167, -0.167, -0.167]),
}
| 50.734177 | 79 | 0.49501 | 643 | 4,008 | 3.080871 | 0.034215 | 0.314992 | 0.386169 | 0.092882 | 0.981323 | 0.967693 | 0.924281 | 0.255931 | 0.255931 | 0.255931 | 0 | 0.136594 | 0.26023 | 4,008 | 78 | 80 | 51.384615 | 0.531535 | 0 | 0 | 0.041096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.013699 | 0 | 0.013699 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
115ef3faca675c8367fb87e880010b049c38092d | 160 | py | Python | arvestust/serializers/tests/__init__.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | 1 | 2021-09-17T23:45:27.000Z | 2021-09-17T23:45:27.000Z | arvestust/serializers/tests/__init__.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | 3 | 2020-07-25T05:40:54.000Z | 2020-08-11T04:01:19.000Z | arvestust/serializers/tests/__init__.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | null | null | null | # arvestust:serializers:tests
from .comment import CommentTestCase
from .file import FileTestCase
from .tag import TagTestCase
from .image import ImageTestCase
| 26.666667 | 36 | 0.84375 | 19 | 160 | 7.105263 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1125 | 160 | 5 | 37 | 32 | 0.950704 | 0.16875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
feff1ce1f4960bf84fdb9d02d07e5e9f1e647013 | 51 | py | Python | src/decoders/__init__.py | norikinishida/DiscourseConstituencyInduction--ViterbiEM | 588eee5626dfa5bdd9a24a2dbefa555d1bc36b8f | [
"MIT"
] | 12 | 2020-04-21T18:21:50.000Z | 2022-03-25T03:36:21.000Z | src/decoders/__init__.py | norikinishida/DiscourseConstituencyInduction--ViterbiEM | 588eee5626dfa5bdd9a24a2dbefa555d1bc36b8f | [
"MIT"
] | null | null | null | src/decoders/__init__.py | norikinishida/DiscourseConstituencyInduction--ViterbiEM | 588eee5626dfa5bdd9a24a2dbefa555d1bc36b8f | [
"MIT"
] | 2 | 2020-04-22T07:13:00.000Z | 2020-06-24T05:57:03.000Z | from .cky import CKYDecoder, IncrementalCKYDecoder
| 25.5 | 50 | 0.862745 | 5 | 51 | 8.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.098039 | 51 | 1 | 51 | 51 | 0.956522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
3a0e6ad23ddb83b8f4bbf00b71c8240a0f96b4de | 86 | py | Python | apps/scrapers/exceptions.py | tractiming/trac-gae | 46c4a1fe409a45e8595210a5cf242425d40d4b41 | [
"MIT"
] | 3 | 2020-09-13T04:56:31.000Z | 2021-05-26T11:46:08.000Z | apps/scrapers/exceptions.py | tractiming/trac-gae | 46c4a1fe409a45e8595210a5cf242425d40d4b41 | [
"MIT"
] | null | null | null | apps/scrapers/exceptions.py | tractiming/trac-gae | 46c4a1fe409a45e8595210a5cf242425d40d4b41 | [
"MIT"
] | 1 | 2020-05-09T10:05:08.000Z | 2020-05-09T10:05:08.000Z | class NoSuchAthlete(Exception):
pass
class TooManyAthletes(Exception):
pass
| 12.285714 | 33 | 0.744186 | 8 | 86 | 8 | 0.625 | 0.40625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186047 | 86 | 6 | 34 | 14.333333 | 0.914286 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
3a5557eff9d5f58241d207c1fc7506ee7a1642d8 | 201 | py | Python | iris_drs_assembly/run_pipeline.py | oirlab/iris_drs_assembly | 34421ff42d88a98eae6ca0234632b4617b21c730 | [
"BSD-3-Clause"
] | 1 | 2021-03-21T13:30:53.000Z | 2021-03-21T13:30:53.000Z | iris_drs_assembly/run_pipeline.py | oirlab/iris_drs_assembly | 34421ff42d88a98eae6ca0234632b4617b21c730 | [
"BSD-3-Clause"
] | 2 | 2021-03-19T02:13:07.000Z | 2021-09-04T01:35:09.000Z | iris_drs_assembly/run_pipeline.py | oirlab/iris_drs_assembly | 34421ff42d88a98eae6ca0234632b4617b21c730 | [
"BSD-3-Clause"
] | null | null | null | import os
import iris_pipeline
iris_pipeline.monkeypatch_jwst_datamodels()
pipeline = iris_pipeline.pipeline.ProcessImagerL2Pipeline
pipeline.call("association.json", config_file="image2_iris.cfg")
| 22.333333 | 64 | 0.850746 | 24 | 201 | 6.833333 | 0.625 | 0.219512 | 0.243902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010638 | 0.064677 | 201 | 8 | 65 | 25.125 | 0.861702 | 0 | 0 | 0 | 0 | 0 | 0.154229 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
28b9fbccbbd0a4960a0dd05165ab6c8e3d3338e0 | 240 | py | Python | api/core/sendgrid/constants.py | sourcery-ai-bot/twitter-clone-server-fastapi | 5ba34303da6b12b61ecb8c1a712bd1a1c318c4bf | [
"MIT"
] | 10 | 2021-06-08T18:35:58.000Z | 2022-03-26T15:56:26.000Z | api/core/sendgrid/constants.py | sourcery-ai-bot/twitter-clone-server-fastapi | 5ba34303da6b12b61ecb8c1a712bd1a1c318c4bf | [
"MIT"
] | 10 | 2021-05-04T04:41:01.000Z | 2021-07-01T03:37:53.000Z | api/core/sendgrid/constants.py | sourcery-ai-bot/twitter-clone-server-fastapi | 5ba34303da6b12b61ecb8c1a712bd1a1c318c4bf | [
"MIT"
] | 5 | 2021-06-14T18:47:56.000Z | 2022-03-26T15:56:30.000Z | # Unsubscribe groups
MAIN_UNSUBSCRIBE_GROUP_ID = 15703
# Dynamic Template IDs
REGISTRATION_CONFIRMATION_DYNAMIC_TEMPLATE_ID = "d-398f7ce806b84c878126d9d5ae4e9a8e"
NEW_NOTIFICATION_DYNAMIC_TEMPLATE_ID = "d-4e340a8932ac473c91fd3a351e805fa5"
| 34.285714 | 84 | 0.883333 | 24 | 240 | 8.375 | 0.666667 | 0.223881 | 0.169154 | 0.179104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206278 | 0.070833 | 240 | 6 | 85 | 40 | 0.695067 | 0.1625 | 0 | 0 | 0 | 0 | 0.343434 | 0.343434 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
28c303c8c4472fee3c05a0a60291b6269943a156 | 611 | py | Python | src/color/ColorService.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | 2 | 2022-01-16T20:44:08.000Z | 2022-01-18T13:41:32.000Z | src/color/ColorService.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | null | null | null | src/color/ColorService.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | null | null | null | from src.color.Color import Color
def get_red() -> Color:
return Color(255, 0, 0)
def get_blue() -> Color:
return Color(0, 0, 255)
def get_green() -> Color:
return Color(0, 255, 0)
def get_orange() -> Color:
return Color(255, 128, 0)
def get_yellow() -> Color:
return Color(255, 255, 0)
def get_purple() -> Color:
return Color(76, 0, 153)
def get_maritime() -> Color:
return Color(0, 255, 255)
def get_shadow() -> Color:
return Color(210, 210, 210)
def get_white() -> Color:
return Color(255, 255, 255)
def get_black() -> Color:
return Color(0, 0, 0)
| 14.547619 | 33 | 0.613748 | 96 | 611 | 3.802083 | 0.239583 | 0.164384 | 0.438356 | 0.208219 | 0.328767 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134904 | 0.235679 | 611 | 41 | 34 | 14.902439 | 0.646681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.47619 | true | 0 | 0.047619 | 0.47619 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 5 |
28f47dd5c3a37215328e301fb5c1835055977e80 | 15,314 | py | Python | gen-py/basicservice/KeyValue.py | RobWC/thrift-fun | e9613797619bc3858b3da92238d9b431f673f329 | [
"Apache-2.0"
] | null | null | null | gen-py/basicservice/KeyValue.py | RobWC/thrift-fun | e9613797619bc3858b3da92238d9b431f673f329 | [
"Apache-2.0"
] | null | null | null | gen-py/basicservice/KeyValue.py | RobWC/thrift-fun | e9613797619bc3858b3da92238d9b431f673f329 | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Iface:
def ping(self):
pass
def setValue(self, key, value):
"""
Parameters:
- key
- value
"""
pass
def add(self, a, b):
"""
Parameters:
- a
- b
"""
pass
class Client(Iface):
def __init__(self, iprot, oprot=None):
self._iprot = self._oprot = iprot
if oprot is not None:
self._oprot = oprot
self._seqid = 0
def ping(self):
self.send_ping()
self.recv_ping()
def send_ping(self):
self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid)
args = ping_args()
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_ping(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = ping_result()
result.read(iprot)
iprot.readMessageEnd()
return
def setValue(self, key, value):
"""
Parameters:
- key
- value
"""
self.send_setValue(key, value)
self.recv_setValue()
def send_setValue(self, key, value):
self._oprot.writeMessageBegin('setValue', TMessageType.CALL, self._seqid)
args = setValue_args()
args.key = key
args.value = value
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_setValue(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = setValue_result()
result.read(iprot)
iprot.readMessageEnd()
return
def add(self, a, b):
"""
Parameters:
- a
- b
"""
self.send_add(a, b)
return self.recv_add()
def send_add(self, a, b):
self._oprot.writeMessageBegin('add', TMessageType.CALL, self._seqid)
args = add_args()
args.a = a
args.b = b
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_add(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = add_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "add failed: unknown result");
class Processor(Iface, TProcessor):
def __init__(self, handler):
self._handler = handler
self._processMap = {}
self._processMap["ping"] = Processor.process_ping
self._processMap["setValue"] = Processor.process_setValue
self._processMap["add"] = Processor.process_add
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
if name not in self._processMap:
iprot.skip(TType.STRUCT)
iprot.readMessageEnd()
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
x.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
return
else:
self._processMap[name](self, seqid, iprot, oprot)
return True
def process_ping(self, seqid, iprot, oprot):
args = ping_args()
args.read(iprot)
iprot.readMessageEnd()
result = ping_result()
self._handler.ping()
oprot.writeMessageBegin("ping", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_setValue(self, seqid, iprot, oprot):
args = setValue_args()
args.read(iprot)
iprot.readMessageEnd()
result = setValue_result()
self._handler.setValue(args.key, args.value)
oprot.writeMessageBegin("setValue", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_add(self, seqid, iprot, oprot):
args = add_args()
args.read(iprot)
iprot.readMessageEnd()
result = add_result()
result.success = self._handler.add(args.a, args.b)
oprot.writeMessageBegin("add", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
# HELPER FUNCTIONS AND STRUCTURES
class ping_args:
thrift_spec = (
)
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ping_args')
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class ping_result:
thrift_spec = (
)
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ping_result')
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class setValue_args:
"""
Attributes:
- key
- value
"""
thrift_spec = (
None, # 0
(1, TType.I32, 'key', None, None, ), # 1
(2, TType.STRING, 'value', None, None, ), # 2
)
def __init__(self, key=None, value=None,):
self.key = key
self.value = value
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I32:
self.key = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.value = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('setValue_args')
if self.key is not None:
oprot.writeFieldBegin('key', TType.I32, 1)
oprot.writeI32(self.key)
oprot.writeFieldEnd()
if self.value is not None:
oprot.writeFieldBegin('value', TType.STRING, 2)
oprot.writeString(self.value)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.key)
value = (value * 31) ^ hash(self.value)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class setValue_result:
thrift_spec = (
)
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('setValue_result')
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class add_args:
"""
Attributes:
- a
- b
"""
thrift_spec = (
None, # 0
(1, TType.I32, 'a', None, None, ), # 1
(2, TType.I32, 'b', None, None, ), # 2
)
def __init__(self, a=None, b=None,):
self.a = a
self.b = b
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I32:
self.a = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I32:
self.b = iprot.readI32();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('add_args')
if self.a is not None:
oprot.writeFieldBegin('a', TType.I32, 1)
oprot.writeI32(self.a)
oprot.writeFieldEnd()
if self.b is not None:
oprot.writeFieldBegin('b', TType.I32, 2)
oprot.writeI32(self.b)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.a)
value = (value * 31) ^ hash(self.b)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class add_result:
"""
Attributes:
- success
"""
thrift_spec = (
(0, TType.I32, 'success', None, None, ), # 0
)
def __init__(self, success=None,):
self.success = success
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 0:
if ftype == TType.I32:
self.success = iprot.readI32();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('add_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.I32, 0)
oprot.writeI32(self.success)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.success)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
| 27.692586 | 188 | 0.65907 | 1,830 | 15,314 | 5.256284 | 0.078689 | 0.016114 | 0.029005 | 0.061129 | 0.765464 | 0.724192 | 0.710469 | 0.687701 | 0.664622 | 0.664622 | 0 | 0.007384 | 0.221758 | 15,314 | 552 | 189 | 27.742754 | 0.799715 | 0.022528 | 0 | 0.713948 | 1 | 0 | 0.018085 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.148936 | false | 0.007092 | 0.014184 | 0.042553 | 0.312057 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
e90a1c66a3ef6edd20100f0cc721d166e4cb36a9 | 137 | py | Python | backend/message/admin.py | IanSteenstra/TherapyNow | cfc8376d188c597f3e66301bdf987e66502c3cf6 | [
"MIT"
] | 3 | 2020-01-24T20:35:22.000Z | 2020-04-13T07:08:05.000Z | backend/message/admin.py | IanSteenstra/TherapyNow | cfc8376d188c597f3e66301bdf987e66502c3cf6 | [
"MIT"
] | 15 | 2019-12-27T22:14:49.000Z | 2020-08-14T17:03:04.000Z | backend/message/admin.py | IanSteenstra/TherapyNow | cfc8376d188c597f3e66301bdf987e66502c3cf6 | [
"MIT"
] | 1 | 2020-11-26T18:20:42.000Z | 2020-11-26T18:20:42.000Z | from django.contrib import admin
from .models import Message, MessageFlag
admin.site.register(Message)
admin.site.register(MessageFlag)
| 22.833333 | 40 | 0.832117 | 18 | 137 | 6.333333 | 0.555556 | 0.157895 | 0.298246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.087591 | 137 | 5 | 41 | 27.4 | 0.912 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
e939a9e677508d6e4b21c7a4bb6442c8b339ac30 | 234 | py | Python | lib/__init__.py | amagdy/islamic_cron_jobs | 29dea92878e9f5fa1456d5c0b6368064dded47c6 | [
"Apache-2.0"
] | 1 | 2017-07-11T22:11:52.000Z | 2017-07-11T22:11:52.000Z | lib/__init__.py | amagdy/islamic_cron_jobs | 29dea92878e9f5fa1456d5c0b6368064dded47c6 | [
"Apache-2.0"
] | null | null | null | lib/__init__.py | amagdy/islamic_cron_jobs | 29dea92878e9f5fa1456d5c0b6368064dded47c6 | [
"Apache-2.0"
] | null | null | null | from lib.MutableTimeInstance import MutableTimeInstance
from lib.PrayerTimesGetter import PrayerTimesGetter
from lib.TimeInstance import TimeInstance
from lib.CronParser import CronParser
from lib.CronParseError import CronParseError
| 39 | 55 | 0.893162 | 25 | 234 | 8.36 | 0.32 | 0.167464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08547 | 234 | 5 | 56 | 46.8 | 0.976636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
3a915cf2c8a995ac9d4031ace91eaada80e4504e | 477 | py | Python | src/oas/content/models.py | sisp/python-oas | 6c988902dd84e0352ba96633ea66fdda91fb6c9d | [
"Apache-2.0"
] | 5 | 2019-04-27T10:36:16.000Z | 2021-12-22T01:45:41.000Z | src/oas/content/models.py | sisp/python-oas | 6c988902dd84e0352ba96633ea66fdda91fb6c9d | [
"Apache-2.0"
] | 37 | 2019-04-26T14:57:25.000Z | 2021-05-28T13:20:46.000Z | src/oas/content/models.py | sisp/python-oas | 6c988902dd84e0352ba96633ea66fdda91fb6c9d | [
"Apache-2.0"
] | 4 | 2019-05-01T12:01:28.000Z | 2021-04-02T14:38:03.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class Content(object):
@abc.abstractproperty
def media_type(self):
"""Return the media type of the content without parameter."""
# TODO: Support parameter
@abc.abstractproperty
def media(self):
"""Return deserialized content."""
| 22.714286 | 69 | 0.740042 | 57 | 477 | 5.824561 | 0.526316 | 0.120482 | 0.192771 | 0.162651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188679 | 477 | 20 | 70 | 23.85 | 0.857881 | 0.228512 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.75 | 0.083333 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
3aacf707d7f1a0f53932e35bcd6ad7b8d088d103 | 297 | py | Python | morpheus/analysis/project_version.py | kajdreef/spidertools | 78a5095582b0bc1fe05a81de5c742fe994de5aa4 | [
"MIT"
] | null | null | null | morpheus/analysis/project_version.py | kajdreef/spidertools | 78a5095582b0bc1fe05a81de5c742fe994de5aa4 | [
"MIT"
] | null | null | null | morpheus/analysis/project_version.py | kajdreef/spidertools | 78a5095582b0bc1fe05a81de5c742fe994de5aa4 | [
"MIT"
] | 1 | 2021-05-02T00:41:09.000Z | 2021-05-02T00:41:09.000Z | from morpheus.analysis.util.java_version import JavaVersion
from morpheus.analysis.util.subject import AnalysisRepo
def project_version(project: AnalysisRepo) -> JavaVersion:
"""
If nothing defined in POM.xml, then, by default, return Java Version 13.
"""
return JavaVersion.J13
| 29.7 | 76 | 0.760943 | 37 | 297 | 6.054054 | 0.648649 | 0.107143 | 0.178571 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016 | 0.158249 | 297 | 9 | 77 | 33 | 0.88 | 0.242424 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
aafd1a0078539037a386840db3750251ef52edf3 | 187 | py | Python | source/devices/LuxDomoticzDevice.py | wotell/alfred-workflow-domoticz | f1219d70808e89bfce41158c0278e1c2fd45d9e7 | [
"MIT"
] | 1 | 2021-12-27T21:58:26.000Z | 2021-12-27T21:58:26.000Z | source/devices/LuxDomoticzDevice.py | wotell/alfred-workflow-domoticz | f1219d70808e89bfce41158c0278e1c2fd45d9e7 | [
"MIT"
] | null | null | null | source/devices/LuxDomoticzDevice.py | wotell/alfred-workflow-domoticz | f1219d70808e89bfce41158c0278e1c2fd45d9e7 | [
"MIT"
] | null | null | null | import DomoticzDevice
class LuxDomoticzDevice(DomoticzDevice.DomoticzDevice):
def __init__(self, room, deviceInfo):
super(LuxDomoticzDevice, self).__init__(room, deviceInfo)
| 31.166667 | 65 | 0.786096 | 17 | 187 | 8.176471 | 0.588235 | 0.201439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128342 | 187 | 5 | 66 | 37.4 | 0.852761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
c92350808f3b7a802095653508ac7a6bacad080b | 143 | py | Python | credentials/credentials_twitter.py | Luc-Bertin/Pi2_project | 64c18b21771df8a244047a8e3156b868ed1089df | [
"MIT"
] | null | null | null | credentials/credentials_twitter.py | Luc-Bertin/Pi2_project | 64c18b21771df8a244047a8e3156b868ed1089df | [
"MIT"
] | null | null | null | credentials/credentials_twitter.py | Luc-Bertin/Pi2_project | 64c18b21771df8a244047a8e3156b868ed1089df | [
"MIT"
] | null | null | null | # this is done creating a LinkedIn app
CONSUMER_KEY = 'PSXYFbBa8Pd8jVk6NIt1R3wlN'
TOKEN = '1PpSRhZHtQpq5QVjVH2CNkwA4Nr7nmspDMlbbv9iiBzXu6Jn7X'
| 35.75 | 60 | 0.853147 | 12 | 143 | 10.083333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.100775 | 0.097902 | 143 | 3 | 61 | 47.666667 | 0.837209 | 0.251748 | 0 | 0 | 0 | 0 | 0.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c9413e7e3590e79b6412cda16699da01ede60050 | 69 | py | Python | twitter/agents/__init__.py | Ra-Ni/Twitter-Language-Identifier | 95e28cc8b0cc7b2acd96f240134649a9e601bca7 | [
"MIT"
] | null | null | null | twitter/agents/__init__.py | Ra-Ni/Twitter-Language-Identifier | 95e28cc8b0cc7b2acd96f240134649a9e601bca7 | [
"MIT"
] | null | null | null | twitter/agents/__init__.py | Ra-Ni/Twitter-Language-Identifier | 95e28cc8b0cc7b2acd96f240134649a9e601bca7 | [
"MIT"
] | null | null | null | from .agent import *
from .evaluator import *
from .trainer import *
| 17.25 | 24 | 0.73913 | 9 | 69 | 5.666667 | 0.555556 | 0.392157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 69 | 3 | 25 | 23 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
c9579df869dc8968450d142c025427f4164c3ee1 | 126 | py | Python | src/selanneal/__init__.py | feichtip/selanneal | 95836a9bcf32deb109938bd26a5b13a1f8240b5d | [
"MIT"
] | 2 | 2021-05-22T23:43:57.000Z | 2021-07-16T13:01:45.000Z | src/selanneal/__init__.py | feichtip/selanneal | 95836a9bcf32deb109938bd26a5b13a1f8240b5d | [
"MIT"
] | null | null | null | src/selanneal/__init__.py | feichtip/selanneal | 95836a9bcf32deb109938bd26a5b13a1f8240b5d | [
"MIT"
] | 1 | 2021-07-16T13:02:00.000Z | 2021-07-16T13:02:00.000Z | from .annealing import run
from .optimise import iterate
from .optimise import roc
__all__ = [
'run', 'iterate', 'roc'
]
| 15.75 | 29 | 0.698413 | 16 | 126 | 5.25 | 0.5 | 0.285714 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.190476 | 126 | 7 | 30 | 18 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0.103175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
a31bcdd89548093e376e88501e12832ea4df3829 | 75 | py | Python | jinahub/segmenters/TorchObjectDetectionSegmenter/__init__.py | sauravgarg540/executors | c06a16633767346eee96ec019ae6a171f125f6cb | [
"Apache-2.0"
] | null | null | null | jinahub/segmenters/TorchObjectDetectionSegmenter/__init__.py | sauravgarg540/executors | c06a16633767346eee96ec019ae6a171f125f6cb | [
"Apache-2.0"
] | null | null | null | jinahub/segmenters/TorchObjectDetectionSegmenter/__init__.py | sauravgarg540/executors | c06a16633767346eee96ec019ae6a171f125f6cb | [
"Apache-2.0"
] | null | null | null | from .torch_object_detection_segmenter import TorchObjectDetectionSegmenter | 75 | 75 | 0.946667 | 7 | 75 | 9.714286 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 75 | 1 | 75 | 75 | 0.944444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
a35351087781fc7ebccd96ca4f4a95acd4fa8d75 | 76 | py | Python | src/rspy/preprocess/__init__.py | nockchun/rspy | 5cc1ebc1d6f91e2de03c34ccd550b6ef2228990e | [
"Apache-2.0"
] | 1 | 2022-02-08T14:29:51.000Z | 2022-02-08T14:29:51.000Z | src/rspy/preprocess/__init__.py | softgood/rspy | 4c8485f2ab6d5572bde46fd62e95cad1b615ce95 | [
"Apache-2.0"
] | null | null | null | src/rspy/preprocess/__init__.py | softgood/rspy | 4c8485f2ab6d5572bde46fd62e95cad1b615ce95 | [
"Apache-2.0"
] | 1 | 2021-05-03T01:47:19.000Z | 2021-05-03T01:47:19.000Z | # -*- coding: utf-8 -*-
from .sequence import *
from .Correlationer import * | 25.333333 | 28 | 0.671053 | 9 | 76 | 5.666667 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015625 | 0.157895 | 76 | 3 | 28 | 25.333333 | 0.78125 | 0.276316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
a3668ccbee1bf89d1303a28ed637041c6708806b | 143 | py | Python | books/tech/py/m_lutz-learning_py-5_ed/code/part_5-modules/ch_23-coding_basics/09-namespaces/main.py | ordinary-developer/education | 1b1f40dacab873b28ee01dfa33a9bd3ec4cfed58 | [
"MIT"
] | null | null | null | books/tech/py/m_lutz-learning_py-5_ed/code/part_5-modules/ch_23-coding_basics/09-namespaces/main.py | ordinary-developer/education | 1b1f40dacab873b28ee01dfa33a9bd3ec4cfed58 | [
"MIT"
] | null | null | null | books/tech/py/m_lutz-learning_py-5_ed/code/part_5-modules/ch_23-coding_basics/09-namespaces/main.py | ordinary-developer/education | 1b1f40dacab873b28ee01dfa33a9bd3ec4cfed58 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
import module1
print(module1.sys)
print(module1.name)
print(module1.func)
print(module1.klass)
| 17.875 | 26 | 0.664336 | 17 | 143 | 5.117647 | 0.529412 | 0.551724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044643 | 0.216783 | 143 | 7 | 27 | 20.428571 | 0.732143 | 0 | 0 | 0 | 0 | 0 | 0.055944 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0.666667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
a3963e6d32db7b59d0ab2d0d6b396113f30b1c6e | 42 | py | Python | comickaze/exceptions.py | Chr1st-oo/comickaze | 048898d4a15c8e8b1d6696c151438b18dde8ffec | [
"MIT"
] | 1 | 2020-08-17T18:31:29.000Z | 2020-08-17T18:31:29.000Z | comickaze/exceptions.py | Chr1st-oo/comickaze | 048898d4a15c8e8b1d6696c151438b18dde8ffec | [
"MIT"
] | null | null | null | comickaze/exceptions.py | Chr1st-oo/comickaze | 048898d4a15c8e8b1d6696c151438b18dde8ffec | [
"MIT"
] | null | null | null | class NoChapterError(Exception):
pass
| 14 | 32 | 0.761905 | 4 | 42 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 42 | 2 | 33 | 21 | 0.914286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
6e61c066f11f215a46cfae83dc282562bbb280e5 | 3,236 | py | Python | colossus/apps/lists/tests/test_models.py | CreativeWurks/emailerpro | 5f8d668d1b98f5add8123794a1802b82381560eb | [
"MIT"
] | 372 | 2018-08-13T20:51:32.000Z | 2022-03-21T12:55:58.000Z | colossus/apps/lists/tests/test_models.py | CreativeWurks/emailerpro | 5f8d668d1b98f5add8123794a1802b82381560eb | [
"MIT"
] | 30 | 2018-08-13T19:34:17.000Z | 2022-03-20T21:28:49.000Z | colossus/apps/lists/tests/test_models.py | CreativeWurks/emailerpro | 5f8d668d1b98f5add8123794a1802b82381560eb | [
"MIT"
] | 117 | 2018-08-13T21:54:42.000Z | 2022-03-24T16:45:48.000Z | from colossus.apps.lists.models import MailingList
from colossus.apps.subscribers.constants import Status
from colossus.apps.subscribers.tests.factories import SubscriberFactory
from colossus.test.testcases import TestCase
from .factories import MailingListFactory
class MailingListUpdateSubscribersCountTests(TestCase):
def setUp(self):
self.mailing_list = MailingListFactory()
def test_update_subscribers_count_persistence(self):
self.assertEqual(0, MailingList.objects.get(pk=self.mailing_list.pk).subscribers_count)
SubscriberFactory(mailing_list=self.mailing_list, status=Status.SUBSCRIBED)
self.mailing_list.update_subscribers_count()
self.assertEqual(1, MailingList.objects.get(pk=self.mailing_list.pk).subscribers_count)
def test_subscribed_count(self):
SubscriberFactory(mailing_list=self.mailing_list, status=Status.SUBSCRIBED)
self.assertEqual(1, self.mailing_list.update_subscribers_count())
def test_subscribed_count_5_subscribers(self):
SubscriberFactory.create_batch(5, mailing_list=self.mailing_list, status=Status.SUBSCRIBED)
self.assertEqual(5, self.mailing_list.update_subscribers_count())
def test_pending_count(self):
SubscriberFactory(mailing_list=self.mailing_list, status=Status.PENDING)
self.assertEqual(0, self.mailing_list.update_subscribers_count())
def test_unsubscribed_count(self):
SubscriberFactory(mailing_list=self.mailing_list, status=Status.UNSUBSCRIBED)
self.assertEqual(0, self.mailing_list.update_subscribers_count())
def test_cleaned_count(self):
SubscriberFactory(mailing_list=self.mailing_list, status=Status.CLEANED)
self.assertEqual(0, self.mailing_list.update_subscribers_count())
class MailingListUpdateOpenRateTests(TestCase):
def setUp(self):
self.mailing_list = MailingListFactory()
SubscriberFactory(mailing_list=self.mailing_list, open_rate=1.0)
SubscriberFactory(mailing_list=self.mailing_list, open_rate=0.0)
def test_update_open_rate(self):
self.assertEqual(0.5, self.mailing_list.update_open_rate())
def test_persistence(self):
self.mailing_list.update_open_rate()
self.assertEqual(0.5, MailingList.objects.get(pk=self.mailing_list.pk).open_rate)
def test_round_percentage(self):
SubscriberFactory(mailing_list=self.mailing_list, open_rate=0.0)
self.assertEqual(0.3333, self.mailing_list.update_open_rate())
class MailingListUpdateClickRateTests(TestCase):
def setUp(self):
self.mailing_list = MailingListFactory()
SubscriberFactory(mailing_list=self.mailing_list, click_rate=1.0)
SubscriberFactory(mailing_list=self.mailing_list, click_rate=0.0)
def test_update_click_rate(self):
self.assertEqual(0.5, self.mailing_list.update_click_rate())
def test_persistence(self):
self.mailing_list.update_click_rate()
self.assertEqual(0.5, MailingList.objects.get(pk=self.mailing_list.pk).click_rate)
def test_round_percentage(self):
SubscriberFactory(mailing_list=self.mailing_list, click_rate=0.0)
self.assertEqual(0.3333, self.mailing_list.update_click_rate())
| 43.72973 | 99 | 0.768541 | 400 | 3,236 | 5.9525 | 0.12 | 0.198656 | 0.195296 | 0.110878 | 0.774045 | 0.773625 | 0.720706 | 0.720706 | 0.657707 | 0.590928 | 0 | 0.013978 | 0.137824 | 3,236 | 73 | 100 | 44.328767 | 0.839427 | 0 | 0 | 0.351852 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.240741 | 1 | 0.277778 | false | 0 | 0.092593 | 0 | 0.425926 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6e8fc168428d4551dc3ca757f3121949eea0575d | 16 | py | Python | toplevel2/broken_package/child2/child2.py | a1exwang/python3-import-sucks | aa7cb60ace2e6507adcbcfbfa5d4bdde9731f2df | [
"MIT"
] | null | null | null | toplevel2/broken_package/child2/child2.py | a1exwang/python3-import-sucks | aa7cb60ace2e6507adcbcfbfa5d4bdde9731f2df | [
"MIT"
] | null | null | null | toplevel2/broken_package/child2/child2.py | a1exwang/python3-import-sucks | aa7cb60ace2e6507adcbcfbfa5d4bdde9731f2df | [
"MIT"
] | null | null | null | print("child2")
| 8 | 15 | 0.6875 | 2 | 16 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 0.0625 | 16 | 1 | 16 | 16 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
6ebab5e76643ce3a7688a64ad3ee8308ce4e74c9 | 6,934 | py | Python | server/src/modules/routing/tests/handlers_tests.py | briannosaurus/go-links | 235ed045414124b0d6f41fc9e4c05117407f18ff | [
"Apache-2.0"
] | 176 | 2019-07-20T00:16:40.000Z | 2022-03-29T08:44:11.000Z | server/src/modules/routing/tests/handlers_tests.py | briannosaurus/go-links | 235ed045414124b0d6f41fc9e4c05117407f18ff | [
"Apache-2.0"
] | 45 | 2019-08-18T17:03:57.000Z | 2022-03-21T14:47:43.000Z | server/src/modules/routing/tests/handlers_tests.py | briannosaurus/go-links | 235ed045414124b0d6f41fc9e4c05117407f18ff | [
"Apache-2.0"
] | 44 | 2019-07-22T07:26:55.000Z | 2022-03-30T19:55:39.000Z | from mock import patch
from modules.data import get_models
from modules.routing import handlers
from testing import TrottoTestCase
ShortLink = get_models('links').ShortLink
class TestRedirectHandlerWithoutLogin(TrottoTestCase):
blueprints_under_test = [handlers.routes]
def test_get__not_logged_in__normal_redirect_from_browser_extension(self):
response = self.testapp.get('/benefits?s=crx')
self.assertEqual(302, response.status_int)
self.assertEqual('http://localhost/_/auth/login?redirect_to=%2Fbenefits%3Fs%3Dcrx', response.location)
def test_get__not_logged_in__http_bare_host_request_coming_from_browser_extension(self):
response = self.testapp.get('/benefits?s=crx&sc=http')
self.assertEqual(302, response.status_int)
self.assertEqual('http://benefits?tr=ot', response.location)
def test_get__not_logged_in__https_bare_host_request_coming_from_browser_extension(self):
response = self.testapp.get('/benefits?s=crx&sc=https')
self.assertEqual(302, response.status_int)
self.assertEqual('https://benefits?tr=ot', response.location)
class TestRedirectHandler(TrottoTestCase):
blueprints_under_test = [handlers.routes]
def setUp(self):
super().setUp()
self._populate_shortlinks()
def _populate_shortlinks(self):
test_shortlinks = [
ShortLink(id=321,
organization='1.com',
owner='jay@1.com',
namespace='go',
shortpath='wiki',
shortpath_prefix='wiki',
destination_url='http://wiki.com'),
ShortLink(organization='1.com',
owner='jay@1.com',
namespace='go',
shortpath='sfdc/%s',
shortpath_prefix='sfdc',
destination_url='http://sfdc.com/search/%s'),
ShortLink(organization='1.com',
owner='bay@1.com',
namespace='go',
shortpath='slack',
shortpath_prefix='slack',
destination_url='http://slack.com'),
ShortLink(organization='1.com',
owner='bay@1.com',
namespace='eng',
shortpath='drive',
shortpath_prefix='drive',
destination_url='https://eng.drive.com'),
ShortLink(organization='2.com',
owner='jay@2.com',
namespace='go',
shortpath='drive',
shortpath_prefix='drive',
destination_url='http://drive3.com')
]
for link in test_shortlinks:
link.put()
def test_redirect__logged_in__go_link_does_not_exist(self):
response = self.testapp.get('/drive',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://localhost:5007/?sp=drive', response.headers['Location'])
def test_redirect__logged_in__simple_go_link(self):
response = self.testapp.get('/wiki',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://wiki.com', response.headers['Location'])
def test_redirect__logged_in__simple_go_link__using_extension(self):
response = self.testapp.get('/wiki?s=crx',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://wiki.com', response.headers['Location'])
def test_redirect__logged_in__go_link_with_pattern(self):
response = self.testapp.get('/sfdc/micro',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://sfdc.com/search/micro', response.headers['Location'])
def test_redirect__logged_in__uppercase_keyword(self):
response = self.testapp.get('/WIKI',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://wiki.com', response.headers['Location'])
def test_redirect__logged_in__pattern_with_uppercase_keyword_and_search_term(self):
response = self.testapp.get('/SFdc/Micro',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://sfdc.com/search/Micro', response.headers['Location'])
@patch('shared_helpers.config.get_organization_config',
side_effect=lambda org: {'namespaces': ['eng', 'prod']} if org == '1.com' else {})
def test_redirect__logged_in__alternate_namespace__no_match(self, _):
response = self.testapp.get('/eng/someplace',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://localhost:5007/?sp=someplace&ns=eng', response.headers['Location'])
@patch('shared_helpers.config.get_organization_config',
side_effect=lambda org: {'namespaces': ['eng', 'prod']} if org == '1.com' else {})
def test_redirect__logged_in__match_for_other_namespace(self, _):
response = self.testapp.get('/drive',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://localhost:5007/?sp=drive', response.headers['Location'])
@patch('shared_helpers.config.get_organization_config',
side_effect=lambda org: {'namespaces': ['eng', 'prod']} if org == '2.com' else {})
def test_redirect__logged_in__alternate_namespace__match_in_other_org(self, _):
response = self.testapp.get('/eng/drive',
headers={'TROTTO_USER_UNDER_TEST': 'rex@2.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://localhost:5007/?sp=drive&ns=eng', response.headers['Location'])
@patch('shared_helpers.config.get_organization_config',
side_effect=lambda org: {'namespaces': ['eng', 'prod']} if org == '1.com' else {})
def test_redirect__logged_in__alternate_namespace__match_in_this_org(self, _):
response = self.testapp.get('/eng/drive',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('https://eng.drive.com', response.headers['Location'])
@patch('shared_helpers.config.get_organization_config',
side_effect=lambda org: {'namespaces': ['wiki', 'prod']} if org == '1.com' else {})
def test_redirect__logged_in__simple_go_link_matching_alternate_namespace(self, _):
response = self.testapp.get('/wiki',
headers={'TROTTO_USER_UNDER_TEST': 'rex@1.com'})
self.assertEqual(302, response.status_int)
self.assertEqual('http://wiki.com', response.headers['Location'])
| 37.89071 | 106 | 0.656331 | 815 | 6,934 | 5.282209 | 0.148466 | 0.097561 | 0.052033 | 0.074797 | 0.815331 | 0.803484 | 0.775842 | 0.722184 | 0.696864 | 0.649013 | 0 | 0.016527 | 0.205942 | 6,934 | 182 | 107 | 38.098901 | 0.765347 | 0 | 0 | 0.488 | 0 | 0 | 0.221373 | 0.074127 | 0 | 0 | 0 | 0 | 0.224 | 1 | 0.128 | false | 0 | 0.032 | 0 | 0.192 | 0.016 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6ee4684ee9ac2647ccfa7290de2b5d8bdbcf70aa | 47 | py | Python | app/orders/domain/exceptions/product_does_not_exist.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | app/orders/domain/exceptions/product_does_not_exist.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | app/orders/domain/exceptions/product_does_not_exist.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | class ProductDoesNotExist(Exception):
pass
| 15.666667 | 37 | 0.787234 | 4 | 47 | 9.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148936 | 47 | 2 | 38 | 23.5 | 0.925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
6eec1e4a170872aebc7e9ce5bacbfdfdbad5ac03 | 305 | py | Python | glue/core/data_factories/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 550 | 2015-01-08T13:51:06.000Z | 2022-03-31T11:54:47.000Z | glue/core/data_factories/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 1,362 | 2015-01-03T19:15:52.000Z | 2022-03-30T13:23:11.000Z | glue/core/data_factories/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 142 | 2015-01-08T13:08:00.000Z | 2022-03-18T13:25:57.000Z | from .astropy_table import * # noqa
from .dendrogram import * # noqa
from .excel import * # noqa
from .fits import * # noqa
from .hdf5 import * # noqa
from .helpers import * # noqa
from .image import * # noqa
from .numpy import * # noqa
from .pandas import * # noqa
from .tables import * # noqa
| 27.727273 | 36 | 0.672131 | 41 | 305 | 4.97561 | 0.341463 | 0.490196 | 0.617647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004255 | 0.229508 | 305 | 10 | 37 | 30.5 | 0.86383 | 0.160656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
42e57f800b36496a25e9d58b4d12e52b54848a56 | 136 | py | Python | leviathan/level/generator/normal.py | envygames/Leviathan | fb08db7e4cd3ad182981fc71224011f5950063b8 | [
"MIT"
] | 16 | 2019-08-08T05:09:48.000Z | 2022-03-20T15:42:03.000Z | leviathan/level/generator/normal.py | envygames/Leviathan | fb08db7e4cd3ad182981fc71224011f5950063b8 | [
"MIT"
] | 4 | 2019-08-06T03:08:22.000Z | 2019-09-23T05:20:58.000Z | leviathan/level/generator/normal.py | envygames/Leviathan | fb08db7e4cd3ad182981fc71224011f5950063b8 | [
"MIT"
] | 9 | 2019-08-10T16:48:41.000Z | 2022-01-24T06:21:52.000Z | from leviathan.api.level.generator import Generator
class Normal(Generator):
def get_id(self):
return self.TYPE_INFINITE
| 17 | 51 | 0.742647 | 18 | 136 | 5.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183824 | 136 | 7 | 52 | 19.428571 | 0.891892 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
42edb48e1de55659fb21667238f92b7e96749e13 | 1,191 | py | Python | 十二、剑指offer-Python/面试题68 - I. 二叉搜索树的最近公共祖先.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | 3 | 2018-08-25T16:14:16.000Z | 2019-10-15T22:25:32.000Z | 十二、剑指offer-Python/面试题68 - I. 二叉搜索树的最近公共祖先.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | null | null | null | 十二、剑指offer-Python/面试题68 - I. 二叉搜索树的最近公共祖先.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | 1 | 2019-10-08T09:03:48.000Z | 2019-10-08T09:03:48.000Z | '''
面试题68 - I. 二叉搜索树的最近公共祖先.py
时间复杂度:O()
空间复杂度:O()
'''
# 迭代解法
# 时间: O(n): 最坏情况,一条单链表,只有左孩子
# 空间: O(1)
class Solution:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
if not root:
return None
if p.val == q.val:
return p
while root:
if root.val < q.val and root.val < p.val:
root = root.right
if root.val > q.val and root.val > p.val:
root = root.left
else:
return root
# 递归解法
# 时间: O(n): 最坏情况,一条单链表,只有左孩子
# 空间: O(n): 递归栈空间
class Solution1:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
if not root:
return None
if p.val > q.val:
p, q = q, p
if p.val == root.val or q.val == root.val:
return root
if p.val < root.val and q.val > root.val:
return root
if p.val < root.val and q.val < root.val:
return self.lowestCommonAncestor(root.left, p, q)
if p.val > root.val and q.val > root.val:
return self.lowestCommonAncestor(root.right, p, q) | 28.357143 | 97 | 0.524769 | 168 | 1,191 | 3.720238 | 0.22619 | 0.1344 | 0.128 | 0.064 | 0.7888 | 0.768 | 0.768 | 0.768 | 0.7008 | 0.7008 | 0 | 0.005122 | 0.344249 | 1,191 | 42 | 98 | 28.357143 | 0.795134 | 0.11419 | 0 | 0.333333 | 0 | 0 | 0.061361 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.074074 | false | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
42ee7fcb5b9d371fa063a260cf401ee8545debea | 2,457 | py | Python | util/metrics.py | TobiahShaw/machine-learning-algorithm | 0ce0e0d463159d8d30b11a15ba98c5a64b2c5b89 | [
"Apache-2.0"
] | null | null | null | util/metrics.py | TobiahShaw/machine-learning-algorithm | 0ce0e0d463159d8d30b11a15ba98c5a64b2c5b89 | [
"Apache-2.0"
] | null | null | null | util/metrics.py | TobiahShaw/machine-learning-algorithm | 0ce0e0d463159d8d30b11a15ba98c5a64b2c5b89 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def accuracy_score(y_true, y_predict):
assert y_true.shape == y_predict.shape,\
"the size of y_true must be equal to the size of y_predict"
return (sum(y_true == y_predict) / len(y_true))
def mean_squared_error(y_true, y_predict):
assert len(y_true) == len(y_predict),\
"the size of y_true must be equal to the size of y_predict"
return np.sum((y_true - y_predict) ** 2) / len(y_true)
def root_mean_squared_error(y_true, y_oredict):
return np.sqrt(mean_squared_error(y_true, y_oredict))
def mean_absolute_error(y_true, y_predict):
assert len(y_true) == len(y_predict),\
"the size of y_true must be equal to the size of y_predict"
return np.sum(np.abs(y_true - y_predict)) / len(y_true)
def r2_score(y_true, y_predict):
return 1 - mean_squared_error(y_true, y_predict) / np.var(y_true)
def TN(y_true, y_predict):
assert len(y_true) == len(y_predict)
return np.sum((y_true == 0) & (y_predict == 0))
def FP(y_true, y_predict):
assert len(y_true) == len(y_predict)
return np.sum((y_true == 0) & (y_predict == 1))
def FN(y_true, y_predict):
assert len(y_true) == len(y_predict)
return np.sum((y_true == 1) & (y_predict == 0))
def TP(y_true, y_predict):
assert len(y_true) == len(y_predict)
return np.sum((y_true == 1) & (y_predict == 1))
def confusion_matrix(y_true, y_predict):
return np.array([
TN(y_true, y_predict), FP(y_true, y_predict),
FN(y_true, y_predict), TP(y_true, y_predict)
])
def precision_score(y_true, y_predict):
assert len(y_true) == len(y_predict)
tp = TP(y_true, y_predict)
fp = FP(y_true, y_predict)
try:
return tp / (tp +fp)
except:
return 0.0
def recall_score(y_true, y_predict):
assert len(y_true) == len(y_predict)
tp = TP(y_true, y_predict)
fn = FN(y_true, y_predict)
try:
return tp / (tp + fn)
except:
return 0.0
def f1_score(y_true, y_predict):
precision = precision_score(y_true, y_predict)
recall = recall_score(y_true, y_predict)
try:
return (2 * precision * recall) / (precision +recall)
except:
return 0.0
def TPR(y_true, y_predict):
return recall_score(y_true, y_predict)
def FPR(y_true, y_predict):
assert len(y_true) == len(y_predict)
tn = TN(y_true, y_predict)
fp = FP(y_true, y_predict)
try:
return fp / (fp +tn)
except:
return 0.0
| 29.25 | 69 | 0.652015 | 428 | 2,457 | 3.453271 | 0.114486 | 0.182679 | 0.133965 | 0.272666 | 0.843708 | 0.70636 | 0.610284 | 0.540595 | 0.487821 | 0.487821 | 0 | 0.010989 | 0.222222 | 2,457 | 83 | 70 | 29.60241 | 0.762428 | 0 | 0 | 0.41791 | 0 | 0 | 0.069597 | 0 | 0 | 0 | 0 | 0 | 0.149254 | 1 | 0.223881 | false | 0 | 0.014925 | 0.059701 | 0.522388 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
6e1d597824a792118a6426b1bed602c8f3012022 | 305 | py | Python | tests/checkio/home/test_long_repeat.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | null | null | null | tests/checkio/home/test_long_repeat.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | 2 | 2017-10-14T17:44:17.000Z | 2018-04-06T18:53:37.000Z | tests/checkio/home/test_long_repeat.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | null | null | null | from checkio.home.long_repeat import long_repeat
def test_long_repeat():
assert long_repeat("sdsffffse") == 4, "First"
assert long_repeat("ddvvrwwwrggg") == 3, "Second"
def test_fails_1():
assert long_repeat("") == 0, "Empty String"
def test_fails_2():
assert long_repeat("aa") == 2
| 20.333333 | 53 | 0.685246 | 43 | 305 | 4.581395 | 0.511628 | 0.35533 | 0.324873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023715 | 0.170492 | 305 | 14 | 54 | 21.785714 | 0.754941 | 0 | 0 | 0 | 0 | 0 | 0.15082 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.375 | true | 0 | 0.125 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6e2816cc3c09324224f877772c3ebc3499c5e2ee | 65 | py | Python | book_search/models/__init__.py | yakky/microservice-talk | 5b59783d5d1f38994e960883f9026a2b11416c7e | [
"CNRI-Python"
] | null | null | null | book_search/models/__init__.py | yakky/microservice-talk | 5b59783d5d1f38994e960883f9026a2b11416c7e | [
"CNRI-Python"
] | 61 | 2020-11-16T06:49:52.000Z | 2022-03-28T00:15:10.000Z | book_search/models/__init__.py | yakky/microservice-talk | 5b59783d5d1f38994e960883f9026a2b11416c7e | [
"CNRI-Python"
] | null | null | null | from .response import BookList as BookListResponse # noqa: F401
| 32.5 | 64 | 0.8 | 8 | 65 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 0.153846 | 65 | 1 | 65 | 65 | 0.890909 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
282910e39638db807ef7766011320331433f05ef | 106 | wsgi | Python | Backend/gjar-iot-server.wsgi | SamuelNovak/GJAR_IoT | 2557eaadb39d286bd5036a96012166098490f614 | [
"MIT"
] | null | null | null | Backend/gjar-iot-server.wsgi | SamuelNovak/GJAR_IoT | 2557eaadb39d286bd5036a96012166098490f614 | [
"MIT"
] | null | null | null | Backend/gjar-iot-server.wsgi | SamuelNovak/GJAR_IoT | 2557eaadb39d286bd5036a96012166098490f614 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
sys.path.append("/GJAR_IoT/Backend")
from main import app as application
| 13.25 | 36 | 0.754717 | 17 | 106 | 4.647059 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010753 | 0.122642 | 106 | 7 | 37 | 15.142857 | 0.83871 | 0.160377 | 0 | 0 | 0 | 0 | 0.193182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
2832294b2072c6962df0ec18b54100c509d4fb56 | 132 | py | Python | diofant/tensor/array/mutable_ndim_array.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | 1 | 2021-08-22T09:34:15.000Z | 2021-08-22T09:34:15.000Z | diofant/tensor/array/mutable_ndim_array.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | null | null | null | diofant/tensor/array/mutable_ndim_array.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | null | null | null | from .ndim_array import NDimArray
class MutableNDimArray(NDimArray):
def _subs(self, old, new, **hints):
return self
| 16.5 | 39 | 0.69697 | 16 | 132 | 5.625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212121 | 132 | 7 | 40 | 18.857143 | 0.865385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
288e1a6d274bc5ca9f6df7f21016b1dfe1ee94b9 | 211 | py | Python | template_secret_info.py | JoaoCampos89/0xbtc-discord-price-bot | 6eb6839213dfb0176c0be72c2dda7193d4131750 | [
"MIT"
] | null | null | null | template_secret_info.py | JoaoCampos89/0xbtc-discord-price-bot | 6eb6839213dfb0176c0be72c2dda7193d4131750 | [
"MIT"
] | null | null | null | template_secret_info.py | JoaoCampos89/0xbtc-discord-price-bot | 6eb6839213dfb0176c0be72c2dda7193d4131750 | [
"MIT"
] | null | null | null |
# to add bot to a server:
# https://discordapp.com/oauth2/authorize?client_id=XXXXXXXXXXXXXXXXXX&scope=bot
CLIENT_ID = "XXXXXXXXXXXXXXXXXX"
TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
| 26.375 | 80 | 0.824645 | 21 | 211 | 8.190476 | 0.761905 | 0.093023 | 0.302326 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005181 | 0.085308 | 211 | 7 | 81 | 30.142857 | 0.88601 | 0.483412 | 0 | 0 | 0 | 0 | 0.721154 | 0.548077 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
9540de174661b9bd4d446dfd42a7b712ddaa009d | 127 | py | Python | atari/dqn/__init__.py | podondra/roboschool-rl | 2e6d6b1302eaa9aea12ebd81e2ad7a22d29a8d69 | [
"MIT"
] | 2 | 2018-03-06T21:26:34.000Z | 2021-12-22T12:31:47.000Z | atari/dqn/__init__.py | podondra/roboschool-rl | 2e6d6b1302eaa9aea12ebd81e2ad7a22d29a8d69 | [
"MIT"
] | 4 | 2019-12-16T20:37:48.000Z | 2020-03-30T20:08:36.000Z | atari/dqn/__init__.py | podondra/roboschool-rl | 2e6d6b1302eaa9aea12ebd81e2ad7a22d29a8d69 | [
"MIT"
] | 2 | 2018-03-06T21:45:19.000Z | 2018-04-06T20:53:15.000Z | from .replay_memory import Preprocessor, ReplayMemory
from .dqn import DQN
__all__ = ['DQN', 'Preprocessor', 'ReplayMemory']
| 21.166667 | 53 | 0.76378 | 14 | 127 | 6.571429 | 0.571429 | 0.521739 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125984 | 127 | 5 | 54 | 25.4 | 0.828829 | 0 | 0 | 0 | 0 | 0 | 0.212598 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
955e807dcb28b072cf48faecf26c45bfb98884bc | 103 | py | Python | python/testData/optimizeImports/referencesInFStringLiterals.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/optimizeImports/referencesInFStringLiterals.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/optimizeImports/referencesInFStringLiterals.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | import sys
from datetime import datetime
print(f'{sys.path}')
def f():
print(f'{datetime.now()}') | 14.714286 | 30 | 0.669903 | 16 | 103 | 4.3125 | 0.5625 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145631 | 103 | 7 | 30 | 14.714286 | 0.784091 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0 | 0.6 | 0.4 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
958ec7eab2e07c44c635e8db8740a3d1287e8615 | 56 | py | Python | codeup100/6089.py | chicCode/dspstutorial_python-ver | 89a1b4a76b7f8143aa7ef9d93cf2b2a9db1f1405 | [
"MIT"
] | 1 | 2021-09-02T08:03:42.000Z | 2021-09-02T08:03:42.000Z | codeup100/6089.py | chicCode/dspstutorial_python-ver | 89a1b4a76b7f8143aa7ef9d93cf2b2a9db1f1405 | [
"MIT"
] | null | null | null | codeup100/6089.py | chicCode/dspstutorial_python-ver | 89a1b4a76b7f8143aa7ef9d93cf2b2a9db1f1405 | [
"MIT"
] | null | null | null | a,b,c = map(int,input().split(' '))
print(a*(b**(c-1)))
| 18.666667 | 35 | 0.5 | 12 | 56 | 2.333333 | 0.75 | 0.142857 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019608 | 0.089286 | 56 | 2 | 36 | 28 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0.017857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
95aad571a513acd9ac6f2a99b363f344e21bd525 | 163 | py | Python | allauth/socialaccount/providers/orcid/urls.py | JoshLabs/django-allauth | d8befb8c97fdba4e1aad4b4d75945899d92effba | [
"MIT"
] | 2 | 2016-08-11T11:57:31.000Z | 2019-05-24T14:53:03.000Z | allauth/socialaccount/providers/orcid/urls.py | JoshLabs/django-allauth | d8befb8c97fdba4e1aad4b4d75945899d92effba | [
"MIT"
] | 9 | 2020-06-05T17:18:43.000Z | 2022-03-11T23:15:04.000Z | allauth/socialaccount/providers/orcid/urls.py | JoshLabs/django-allauth | d8befb8c97fdba4e1aad4b4d75945899d92effba | [
"MIT"
] | 3 | 2015-08-13T22:28:36.000Z | 2016-07-04T18:46:46.000Z | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import OrcidProvider
urlpatterns = default_urlpatterns(OrcidProvider)
| 27.166667 | 75 | 0.871166 | 17 | 163 | 8.235294 | 0.647059 | 0.257143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006667 | 0.079755 | 163 | 5 | 76 | 32.6 | 0.926667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
95cfbff8b31f39bcacd138ccf71607445d3efe8a | 108 | py | Python | python/testData/inspections/ChainedComparison3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/ChainedComparison3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/ChainedComparison3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | if <weak_warning descr="Simplify chained comparison">e >= <caret>a > b and c < b</weak_warning>:
print "q" | 54 | 96 | 0.694444 | 18 | 108 | 4.055556 | 0.833333 | 0.30137 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 108 | 2 | 97 | 54 | 0.793478 | 0 | 0 | 0 | 0 | 0 | 0.256881 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.5 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
2500d895f98d67ebcaea7912acb6a48bcd8e8e2b | 87 | py | Python | models/__init__.py | OttrOne/suivi | 9e53a39b0f50054b89cb960eb9055fd0a28a5ebf | [
"MIT"
] | null | null | null | models/__init__.py | OttrOne/suivi | 9e53a39b0f50054b89cb960eb9055fd0a28a5ebf | [
"MIT"
] | 2 | 2022-01-11T15:50:04.000Z | 2022-01-13T01:53:53.000Z | models/__init__.py | OttrOne/suivi | 9e53a39b0f50054b89cb960eb9055fd0a28a5ebf | [
"MIT"
] | null | null | null | from .sample import Sample
from .sampleset import SampleSet
from .config import Config
| 21.75 | 32 | 0.827586 | 12 | 87 | 6 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 87 | 3 | 33 | 29 | 0.96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
25271cb13c810d2c4a0ee196f2b52cf206a7bc12 | 34 | py | Python | seq2seq/dataset/__init__.py | EVASHINJI/Seq2Seq-PyTorch | d53f8d7c240bd7c16ebd1475384774bd064b4b03 | [
"Apache-2.0"
] | 4 | 2020-01-03T09:14:10.000Z | 2021-07-04T14:39:45.000Z | seq2seq/dataset/__init__.py | EVASHINJI/Seq2Seq-PyTorch | d53f8d7c240bd7c16ebd1475384774bd064b4b03 | [
"Apache-2.0"
] | null | null | null | seq2seq/dataset/__init__.py | EVASHINJI/Seq2Seq-PyTorch | d53f8d7c240bd7c16ebd1475384774bd064b4b03 | [
"Apache-2.0"
] | 2 | 2020-01-09T10:08:30.000Z | 2020-01-10T01:54:01.000Z | from .vocabField import VocabField | 34 | 34 | 0.882353 | 4 | 34 | 7.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088235 | 34 | 1 | 34 | 34 | 0.967742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
25609a243bc5e59057e16d18b115f846ecfcf60b | 61 | py | Python | analisador_sintatico/ext/cors.py | viniciusandd/uri-analisador-sintatico | b347f4293e4c60bd3b2c838c8cef0d75db2c0bec | [
"MIT"
] | null | null | null | analisador_sintatico/ext/cors.py | viniciusandd/uri-analisador-sintatico | b347f4293e4c60bd3b2c838c8cef0d75db2c0bec | [
"MIT"
] | null | null | null | analisador_sintatico/ext/cors.py | viniciusandd/uri-analisador-sintatico | b347f4293e4c60bd3b2c838c8cef0d75db2c0bec | [
"MIT"
] | null | null | null | from flask_cors import CORS
def init_app(app):
CORS(app) | 15.25 | 27 | 0.737705 | 11 | 61 | 3.909091 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180328 | 61 | 4 | 28 | 15.25 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
c25daa2dd3f6714f6d28c2f76682e519c97643c2 | 134 | py | Python | tests/__main__.py | tjguk/winsys | 346a5bc0ad74f3f70b1099e714b544a6f008b72c | [
"MIT"
] | 51 | 2015-01-14T09:23:48.000Z | 2021-11-08T12:53:54.000Z | tests/__main__.py | tjguk/winsys | 346a5bc0ad74f3f70b1099e714b544a6f008b72c | [
"MIT"
] | 2 | 2019-05-30T12:34:40.000Z | 2020-06-13T20:00:55.000Z | tests/__main__.py | tjguk/winsys | 346a5bc0ad74f3f70b1099e714b544a6f008b72c | [
"MIT"
] | 15 | 2015-04-21T19:48:48.000Z | 2020-07-29T19:30:43.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys
from . import run
run.main(os.path.dirname(__file__))
| 19.142857 | 39 | 0.731343 | 20 | 134 | 4.45 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008621 | 0.134328 | 134 | 6 | 40 | 22.333333 | 0.758621 | 0.156716 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
c27648c9cec98bed5825743ab82b2970e0fac754 | 113 | py | Python | queryutils/versions.py | salspaugh/queryutils | fb3ab2e3e5c17e55ae87217b66ae33c205a50c70 | [
"BSD-3-Clause"
] | null | null | null | queryutils/versions.py | salspaugh/queryutils | fb3ab2e3e5c17e55ae87217b66ae33c205a50c70 | [
"BSD-3-Clause"
] | null | null | null | queryutils/versions.py | salspaugh/queryutils | fb3ab2e3e5c17e55ae87217b66ae33c205a50c70 | [
"BSD-3-Clause"
] | null | null | null | class Version:
FORMAT_2012 = "format_2012"
FORMAT_2013 = "format_2013"
FORMAT_2014 = "format_2014"
| 16.142857 | 31 | 0.690265 | 14 | 113 | 5.142857 | 0.428571 | 0.277778 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 0.221239 | 113 | 6 | 32 | 18.833333 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0.294643 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c284ee68caf2858865a298966d3eb7f3bf5434ff | 296 | py | Python | framework/lib/dlju/os_utils.py | audreyseo/defects4j | e412c83d9ef2594b9e70e56b3ed78d71efc15713 | [
"MIT"
] | null | null | null | framework/lib/dlju/os_utils.py | audreyseo/defects4j | e412c83d9ef2594b9e70e56b3ed78d71efc15713 | [
"MIT"
] | null | null | null | framework/lib/dlju/os_utils.py | audreyseo/defects4j | e412c83d9ef2594b9e70e56b3ed78d71efc15713 | [
"MIT"
] | null | null | null | """ Figure out which operating system is being used
"""
import platform
def isMacOsX():
return platform.system() == "Darwin"
def isLinux():
return platform.system() == "Linux"
def isWindows():
return platform.system() == "Windows" or platform.system().lower().startswith("cygwin")
| 22.769231 | 91 | 0.682432 | 34 | 296 | 5.941176 | 0.647059 | 0.277228 | 0.29703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158784 | 296 | 12 | 92 | 24.666667 | 0.811245 | 0.158784 | 0 | 0 | 0 | 0 | 0.099585 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | true | 0 | 0.142857 | 0.428571 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 5 |
c2891a5a08a7c52df2a2784d642b9a54e576660b | 23 | py | Python | Dirv1/changeOne.py | kaushiktalukdar/GithubFeatureTest | 393606d5b1b6abe3d55156e6647285ade0d6d7a2 | [
"Apache-2.0"
] | null | null | null | Dirv1/changeOne.py | kaushiktalukdar/GithubFeatureTest | 393606d5b1b6abe3d55156e6647285ade0d6d7a2 | [
"Apache-2.0"
] | 11 | 2021-11-24T02:03:37.000Z | 2021-11-25T00:31:27.000Z | Dirv1/changeOne.py | kaushiktalukdar/GithubFeatureTest | 393606d5b1b6abe3d55156e6647285ade0d6d7a2 | [
"Apache-2.0"
] | null | null | null | # This is a change test | 23 | 23 | 0.73913 | 5 | 23 | 3.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217391 | 23 | 1 | 23 | 23 | 0.944444 | 0.913043 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c2a8961876c93562e723dabb09e2fff2563bd672 | 51 | py | Python | grAdapt/datasets/testfunctions/__init__.py | mkduong-ai/grAdapt | 94c2659b0f6ff9a2984a9dc58e3c83213313bf90 | [
"Apache-2.0"
] | 25 | 2020-11-13T05:57:01.000Z | 2021-06-18T11:16:03.000Z | grAdapt/datasets/testfunctions/__init__.py | mkduong-ai/grAdapt | 94c2659b0f6ff9a2984a9dc58e3c83213313bf90 | [
"Apache-2.0"
] | null | null | null | grAdapt/datasets/testfunctions/__init__.py | mkduong-ai/grAdapt | 94c2659b0f6ff9a2984a9dc58e3c83213313bf90 | [
"Apache-2.0"
] | null | null | null | from . import bivariate
from . import multivariate
| 17 | 26 | 0.803922 | 6 | 51 | 6.833333 | 0.666667 | 0.487805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156863 | 51 | 2 | 27 | 25.5 | 0.953488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
c2d81992abc4175135fad7f77eb6db0554f8097b | 7,260 | py | Python | 2015/task_1/second.py | romanthekat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | null | null | null | 2015/task_1/second.py | romanthekat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | 5 | 2016-07-03T19:07:55.000Z | 2019-12-10T19:24:25.000Z | 2015/task_1/second.py | EvilKhaosKat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | null | null | null | input = "((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()()())))))))))()((((((())((()))(((((()(((((((((()()))((()(())()((())((()(()))((()))()))()(((((()(((()()))()())((()((((())()())()((((())()(()(()(((()(())(()(())(((((((())()()(((())(()(()(()(())))(()((((())((()))(((()(()()(((((()()(()(((()(((((())()))()((()(()))()((()((((())((((())(()(((())()()(()()()()()(())((((())((())(()()))()((((())))((((()())()((((())((()())((())(())(((((()((((()(((()((((())(()(((()()))()))((((((()((())()())))(((()(()))(()()(()(((()(()))((()()()())((()()()(((())())()())())())((()))(()(()))(((((()(()(())((()(())(())()((((()())()))((((())(())((())())((((()(((())(())((()()((((()((((((()(())()()(()(()()((((()))(())()())()))(())))(())))())()()(())(()))()((()(()(())()()))(()())))))(()))(()()))(())(((((()(()(()()((())()())))))((())())((())(()(())((()))(())(((()((((((((()()()(()))()()(((()))()((()()(())(())())()(()(())))(((((()(())(())(()))))())()))(()))()(()(((((((()((((())))())())())())()((((((((((((((()()((((((()()()())())()())())())(())(())))())((()())((()(()))))))()))))))))))))))))())((())((())()()))))))(((()((()(()()))((())(()()))()()())))(())))))))(()(((())))())()())))()()(())()))()(()))())((()()))))(()))))()))(()()(())))))))()(((()))))()(()))(())())))))()))((()))((()))())(())))))))))((((())()))()))()))())(())()()(())))())))(()())()))((()()(())))(())((((((()(())((()(((()(()()(())))()))))))()))()(()((()))()(()))(()(((())((((())())(())(()))))))))())))))))())())))))())))))()()(((())()(()))))))))())))))(())()()()))()))()))(()(())()()())())))))))())()(()(()))))()()()))))())(()))))()()))))()())))))(((())()()))(()))))))))))()()))))()()()))))(()())())()()())()(()))))()(()))(())))))))(((((())(())())()()))()()))(())))))()(()))))(())(()()))()())()))()))()))()))))())()()))())())))(()))(()))))))())()(((())()))))))))()))()())))())))())))()))))))))))()()))(()()))))))(())()(()))))())(()))))(()))))(()())))))())())()()))))())()))))))))(()))))()))))))()(()())))))))()))())))())))())))())))))))())(()()))))))(()())())))()())()))))))))))))))())))()(())))()))())()()(())(()()))(())))())()())(()(()(()))))())))))))))))())(()))()))()))))(())()())()())))))))))))()()))))))))))))())())))))(()())))))))))))())(())))()))))))))())())(()))()))(())))()))()()(())()))))))()((((())()))())())))))()))()))))((()())()))))())))(())))))))))))))))))()))))()()())()))()()))))())()))((()())))())))(()))(()())))))))()))()))))(())))))))(())))))())()()(()))())()))()()))))())()()))))())()))())))))))(()))))()())()))))))))(()))())))(()))()))))(())()))())())(())())())))))))((((())))))()))()))()())()(())))()))()))()())(()())()()(()())()))))())())))))(()))()))))())(()()(())))))(())()()((())())))))(())(())))))))())))))))))()(())))))))()())())())()(()))))))))(()))))))))())()()))()(()))))))()))))))())))))))(())))()()(())()())))))(((())))()((())()))())))(()()))())(())())))()(((()())))))()(()()())))()()(()()(()()))())()(()()()))())()()))()())(()))))())))))())))(())()()))))(()))))(())(()))(())))))()()))()))))())()))()()(())())))((()))())()))))))()()))))((()(()))))()()))))))())))))())(()((()())))))))))))()())())))()))(()))))))(()))(())()())))(()))))))))())()()()()))))(()())))))))((())))()))(()))(())(())()())()))))))))(())))())))(()))()()))(()()))(()))())))()(())))())((()((()(())))((())))()))))((((())())()())))(())))()))))))())(()()((())))())()(()())))))(()())()))())))))))((())())))))))(()(()))())()()(()()(((()(((()())))))()))))))()(())(()()((()()(())()()))())()())()))()())())())))))))(((())))))))()()))))))(((())()))(()()))(()()))))(()(()()((((())()())((()()))))(()(())))))()((()()()())()()((()((()()))(()))(((()()()))(((())))()(((())()))))))((()(())())))(()())(((((()(()))(()((()))(()())()))))(()(()))()(()))(())(((())(()()))))()()))(((()))))(()()()()))())))((()()()(())()))()))))()()))()))))))((((((()()()))))())((()()(((()))))(()(())(()()())())())))()(((()()))(())((())))(()))(()()()())((())())())(()))))()))()((()(())()(()()(())(()))(())()))(())(()))))(())(())())(()()(()((()()((())))((()))()((())))(((()()()()((((()))(()()))()()()(((())((())())(()()(()()()))()((())(())()))())(((()()(())))()((()()())()())(()(())())(((())(())())((())(())()(((()()))(())))((())(()())())(())((()()()((((((())))((()(((((())()))()))(())(()()))()))(())()()))(())((()()())()()(()))())()((())))()((()()())((((()())((())())())((()((()))()))((())((()()(()((()()(((())(()()))))((()((())()(((())(()((())())((())(()((((((())())()(()())()(())(((())((((((()(())(()((()()()((()()(()()()())))()()(((((()()))()((((((()))()(()(()(()(((()())((()))())()((()))(())))()))()()))())()()))())((((())(()(()))(((((((())(((()(((((()(((()()((((())(((())())))(()()()(()(()))()))((((((()))((()(((()(())((()((((()((((((())(((((())))(((()(()))))(((()(((())()((())(()((()))(((()()(((())((((()(()(((((()))(((()(((((((()(()()()(()(()(()()())(())(((((()(())())()())(()(()(()))()(()()()())(()()(()((()))()((())())()(()))((())(()))()(()))()(((()(()(()((((((()()()()())()(((((()()(((()()()((()(((((()))((((((((()()()(((((()))))))(()()()(())(()))(()()))))(())()))(((((()(((((()()(()(()())(((()))((((()((()(()(()((()(()((())))()(((()((()))((()))(((((((((()((()((()(())))()((((()((()()))((())(((()(((((()()(()(()()((()(()()()(((((((())())()())))))((((()()(()))()))(()((())()(()(((((((((()()(((()(()())(()((()())((())())((((()(((()(((()((((()((()((((()(()((((((())((((((((((((()()(()()((((((((((((((()((()()))()((((((((((((())((((()(()())((()(()(()))()(((((()()(((()()))()())(())((()(((((()((())(((((()((()(((((()))()()((((())()((((())(((((((((()(())(()(())))())(()((())(((())(())(())())(()(()(())()()((()((())()(((()(((((()(())))()(((()((())))((()()()(((()(((()((()(()(())(()((()())(()(()(((()(((((((((())(()((((()()))(()((((()()()()(((()((((((((()(()()((((((()(()()(()((()((((((((((()()(((((((()())(())))(((()()))(((((()((()()())(()()((((())((()((((()))))(())((()(()()(((()(()(((()((((()(((((()))())())(()((())()))(((()())((())((())((((()((()((((((())(()((((()()))((((((())()(()))((()(((())((((((((((()()(((((()(((((()((()()()((((())))(()))()((()(())()()((()((((((((((()((())(())(((((()(()(()()))((((()((((()()((()(((()(((((((((()(()((()((()))((((((()(((())()()((()(((((((()())))()()(()((()((()()(((()(()()()()((((()((())((((()(((((((((()(((()()(((()(()(((()(((()((())()(()((()(()(()(()))()(((()))(()((((()((())((((())((((((())(()))(()((((())((()(()((((((((()()((((((()(()(()()()(())((()((()()(((()(((((((()()((()(((((((()))(((((()(((()(()()()(()(((()((()()((())(()(((((((((()(()((()((((((()()((())()))(((((()((())()())()(((((((((((()))((((()()()()())(()()(()(()()))()))(()))(()(((()()))())(()(()))()()((())(()())()())()(()))()))(()()(()((((((())((()(((((((((((()(())()((()(()((()((()(()((()((((((((((()()())((())()(())))((())()())()(((((()(()())((((()((()(())(()))(((())()((()))(((((())(()))()()(()))(((())((((()((((()(())))(((((((()))))())()())(())((())()(()()((()(()))()(()()(()()((()())((())((()()))((((()))()()))(()()(())()()(((((()(())((()((((()))()))(()())())(((()()(()()))(())))))(()))((())(((((()((((()))()((((()))()((())(((())))(((()())))((()(()()(("
result = 0
for position, char in enumerate(input):
if char == "(":
result += 1
elif char == ")":
result -= 1
if result == -1: # in basement
print("position of first basement:" + str(position+1))
break
| 518.571429 | 7,010 | 0.018595 | 31 | 7,260 | 4.354839 | 0.548387 | 0.155556 | 0.162963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000697 | 0.011983 | 7,260 | 13 | 7,011 | 558.461538 | 0.018124 | 0.001515 | 0 | 0 | 0 | 0 | 0.969919 | 0.965917 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c2ea6c45305731a55ec84c58f7c0aaae7e643cf6 | 98 | py | Python | __getPythonSitePackages.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | __getPythonSitePackages.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | __getPythonSitePackages.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | '''a Python program to locate Python site-packages.'''
import site;
print(site.getsitepackages()) | 32.666667 | 54 | 0.755102 | 13 | 98 | 5.692308 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102041 | 98 | 3 | 55 | 32.666667 | 0.840909 | 0.489796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 5 |
c2f2a1ef6eac3d5bc5d4b36c7883e57247c77ed1 | 86 | py | Python | nasa.py | scollis/flaming_heap | 4462c2dd2872fbceff0d6a21ffb4cf2ff18f6bea | [
"BSD-2-Clause"
] | null | null | null | nasa.py | scollis/flaming_heap | 4462c2dd2872fbceff0d6a21ffb4cf2ff18f6bea | [
"BSD-2-Clause"
] | null | null | null | nasa.py | scollis/flaming_heap | 4462c2dd2872fbceff0d6a21ffb4cf2ff18f6bea | [
"BSD-2-Clause"
] | null | null | null | print('To Infinity and Beyond!')
print('Toy story should have ended with the 3 one.')
| 28.666667 | 52 | 0.732558 | 15 | 86 | 4.2 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013699 | 0.151163 | 86 | 2 | 53 | 43 | 0.849315 | 0 | 0 | 0 | 0 | 0 | 0.767442 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
6c0f227ebf72e5c62ecac794b83d6c52a90a14ed | 50 | py | Python | deepl/optimizer/__init__.py | akanametov/deepl | c24c797bc815aa78e4d337d7e8bbb422dbf6dc20 | [
"MIT"
] | null | null | null | deepl/optimizer/__init__.py | akanametov/deepl | c24c797bc815aa78e4d337d7e8bbb422dbf6dc20 | [
"MIT"
] | null | null | null | deepl/optimizer/__init__.py | akanametov/deepl | c24c797bc815aa78e4d337d7e8bbb422dbf6dc20 | [
"MIT"
] | null | null | null | from .__base__ import *
from .optimizers_ import * | 25 | 26 | 0.78 | 6 | 50 | 5.666667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 50 | 2 | 26 | 25 | 0.790698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
6c4a1cc073be8ebf28f81ff779143c1fe6f03c23 | 231 | py | Python | libpgm3/__init__.py | aleksandar-veljkovic/libpgm3 | f39a20b17e9934f35cce16bc65c9745cf2355fd7 | [
"BSD-3-Clause"
] | 83 | 2015-02-04T02:05:50.000Z | 2020-12-21T03:22:39.000Z | libpgm/__init__.py | shark8me/libpgm | bbaabd44a6ba525c2e7e2f5c32c4d09fbd1c5cc2 | [
"BSD-3-Clause"
] | 26 | 2015-03-10T11:22:39.000Z | 2020-05-27T23:48:21.000Z | libpgm/__init__.py | shark8me/libpgm | bbaabd44a6ba525c2e7e2f5c32c4d09fbd1c5cc2 | [
"BSD-3-Clause"
] | 50 | 2015-03-02T12:49:31.000Z | 2020-05-26T07:36:48.000Z | __all__ = ['CPDtypes', 'dictionary', 'discretebayesiannetwork', 'graphskeleton', 'hybayesiannetwork', 'lgbayesiannetwork', 'nodedata', 'orderedskeleton', 'pgmlearner', 'sampleaggregator', 'tablecpdfactor', 'tablecpdfactorization']
| 115.5 | 230 | 0.774892 | 13 | 231 | 13.461538 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.060606 | 231 | 1 | 231 | 231 | 0.806452 | 0 | 0 | 0 | 0 | 0 | 0.744589 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6692e436d23de7fd2ba1005b36882dbed2acd577 | 4,965 | py | Python | database.py | luke-truitt/standard-venmo-backend | fb7f9c395872fb1964797ffc882293776444edb1 | [
"MIT"
] | null | null | null | database.py | luke-truitt/standard-venmo-backend | fb7f9c395872fb1964797ffc882293776444edb1 | [
"MIT"
] | null | null | null | database.py | luke-truitt/standard-venmo-backend | fb7f9c395872fb1964797ffc882293776444edb1 | [
"MIT"
] | null | null | null | import psycopg2
import os
import uuid
from datetime import datetime
CLEAR_WAITLIST_TABLE = "DELETE FROM Waitlist"
DROP_WAITLIST_TABLE = "DROP TABLE Waitlist"
CREATE_WAITLIST_TABLE = """CREATE TABLE WAITLIST (
Email varchar(255),
LandingPageID int,
Time varchar(255)
)"""
ADD_EMAIL = "INSERT INTO waitlist (email, landingPageId, time) values ('{}','{}','{}')"
def add_email(data):
email = data.get("email") if data.get("email") is not None else ''
landingPageId = data.get("landingPageId") if data.get("landingPageId") is not None else ''
waitlist_spot = get_waitlist_position(landingPageId) + 1000
now = datetime.now()
time = now.strftime("%d/%m/%Y %H:%M:%S")
try:
conn = psycopg2.connect(
# database = os.getenv("DATABASE"),
# user = os.getenv("USERNAME"),
# password = os.getenv("PASSWORD"),
# host = os.getenv("HOST"),
# port = os.getenv("DATAPORT"),
database = "der447s69tcb66",
user = "veirluzsqkanmi",
password = "0e01540c042256fae0efbfb765bd5377c60c54b56c2df6192598d380c45d928d",
host = "ec2-54-237-143-127.compute-1.amazonaws.com",
port = "5432"
)
cur = conn.cursor()
cur.execute(ADD_EMAIL.format(email,landingPageId, time))
conn.commit()
cur.close()
conn.close()
return waitlist_spot
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn is not None:
conn.close()
def get_waitlist_position(num):
try:
conn = psycopg2.connect(
# database = os.getenv("DATABASE"),
# user = os.getenv("USERNAME"),
# password = os.getenv("PASSWORD"),
# host = os.getenv("HOST"),
# port = os.getenv("DATAPORT"),
database = "der447s69tcb66",
user = "veirluzsqkanmi",
password = "0e01540c042256fae0efbfb765bd5377c60c54b56c2df6192598d380c45d928d",
host = "ec2-54-237-143-127.compute-1.amazonaws.com",
port = "5432"
)
cur = conn.cursor()
cur.execute("SELECT email FROM waitlist WHERE landingPageId={}".format(num))
waitlist = cur.fetchall()
waitlist_len = len(waitlist)
spot = waitlist_len + 1
cur.close()
conn.close()
return spot
except (Exception, psycopg2.DatabaseError) as error:
print(error)
def create_table():
try:
conn = psycopg2.connect(
# database = os.getenv("DATABASE"),
# user = os.getenv("USERNAME"),
# password = os.getenv("PASSWORD"),
# host = os.getenv("HOST"),
# port = os.getenv("DATAPORT")
database = "der447s69tcb66",
user = "veirluzsqkanmi",
password = "0e01540c042256fae0efbfb765bd5377c60c54b56c2df6192598d380c45d928d",
host = "ec2-54-237-143-127.compute-1.amazonaws.com",
port = "5432"
)
cur = conn.cursor()
cur.execute(CREATE_WAITLIST_TABLE)
conn.commit()
cur.close()
conn.close()
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn is not None:
conn.close()
def clear_table() :
try:
conn = psycopg2.connect(
# database = os.getenv("DATABASE"),
# user = os.getenv("USERNAME"),
# password = os.getenv("PASSWORD"),
# host = os.getenv("HOST"),
# port = os.getenv("DATAPORT")
database = "der447s69tcb66",
user = "veirluzsqkanmi",
password = "0e01540c042256fae0efbfb765bd5377c60c54b56c2df6192598d380c45d928d",
host = "ec2-54-237-143-127.compute-1.amazonaws.com",
port = "5432"
)
cur = conn.cursor()
cur.execute(CLEAR_WAITLIST_TABLE)
conn.commit()
cur.close()
conn.close()
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn is not None:
conn.close()
def drop_tables():
try:
conn = psycopg2.connect(
database = os.getenv("DATABASE"),
user = os.getenv("USERNAME"),
password = os.getenv("PASSWORD"),
host = os.getenv("HOST"),
port = os.getenv("DATAPORT")
)
cur = conn.cursor()
cur.execute(DROP_WAITLIST_TABLE)
conn.commit()
cur.close()
conn.close()
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn is not None:
conn.close()
# drop_tables()
# create_table() | 32.45098 | 94 | 0.544814 | 466 | 4,965 | 5.744635 | 0.180258 | 0.074711 | 0.020172 | 0.041091 | 0.735525 | 0.7161 | 0.706014 | 0.706014 | 0.706014 | 0.683227 | 0 | 0.086693 | 0.335549 | 4,965 | 153 | 95 | 32.45098 | 0.724765 | 0.129305 | 0 | 0.628319 | 0 | 0 | 0.208556 | 0.098582 | 0 | 0 | 0 | 0 | 0 | 1 | 0.044248 | false | 0.044248 | 0.035398 | 0 | 0.097345 | 0.044248 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dd02c45cc38a47318fa4a2cdc928b426105a1551 | 213 | py | Python | agents/Random/random_agent.py | ksang/Voigt-Kampff | 21f9ad172e5edf0fe50479eba816413f477b4c70 | [
"MIT"
] | 3 | 2018-07-28T09:21:45.000Z | 2020-04-11T15:01:12.000Z | agents/Random/random_agent.py | ksang/Voigt-Kampff | 21f9ad172e5edf0fe50479eba816413f477b4c70 | [
"MIT"
] | null | null | null | agents/Random/random_agent.py | ksang/Voigt-Kampff | 21f9ad172e5edf0fe50479eba816413f477b4c70 | [
"MIT"
] | null | null | null | from agents import BaseAgent
class RandomAgent(BaseAgent):
def __init__(self, env, config):
super().__init__(env, config)
def take_action(self, state):
return self.action_space.sample()
| 21.3 | 41 | 0.690141 | 26 | 213 | 5.269231 | 0.692308 | 0.131387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206573 | 213 | 9 | 42 | 23.666667 | 0.810651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.166667 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
dd0b13b298e088cf0565399c7a4550acc4a6be31 | 565 | py | Python | src/compas_blender/utilities/document.py | arpastrana/compas | ed677a162c14dbe562c82d72f370279259faf7da | [
"MIT"
] | null | null | null | src/compas_blender/utilities/document.py | arpastrana/compas | ed677a162c14dbe562c82d72f370279259faf7da | [
"MIT"
] | 9 | 2019-09-11T08:53:19.000Z | 2019-09-16T08:35:39.000Z | src/compas_blender/utilities/document.py | Licini/compas | 34f65adb3d0abc3f403312ffba62aa76f3376292 | [
"MIT"
] | null | null | null |
__all__ = [
'get_document_name',
'get_document_filename',
'get_document_path',
'get_document_dirname'
]
def get_document_name():
raise NotImplementedError
def get_document_filename():
raise NotImplementedError
def get_document_path():
raise NotImplementedError
def get_document_dirname():
raise NotImplementedError
# ==============================================================================
# Main
# ==============================================================================
if __name__ == '__main__':
pass
| 17.121212 | 80 | 0.515044 | 42 | 565 | 6.261905 | 0.309524 | 0.334601 | 0.212928 | 0.342205 | 0.43346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148673 | 565 | 32 | 81 | 17.65625 | 0.546778 | 0.286726 | 0 | 0.25 | 0 | 0 | 0.208543 | 0.052764 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.0625 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
dd44e5064bf5fe1fa7311d1765cd773f989f0ec2 | 15 | py | Python | certbot_plugin_duckdns/__init__.py | lennart-k/certbot-plugin-duckdns | 1c42dd62bcd752b5a5e454009356276b8d9d371d | [
"MIT"
] | 2 | 2022-03-19T17:59:41.000Z | 2022-03-25T12:54:00.000Z | certbot_plugin_duckdns/__init__.py | lennart-k/certbot-plugin-duckdns | 1c42dd62bcd752b5a5e454009356276b8d9d371d | [
"MIT"
] | 15 | 2022-03-16T23:29:42.000Z | 2022-03-25T16:51:14.000Z | certbot_plugin_duckdns/__init__.py | lennart-k/certbot-plugin-duckdns | 1c42dd62bcd752b5a5e454009356276b8d9d371d | [
"MIT"
] | null | null | null | """__init__"""
| 7.5 | 14 | 0.533333 | 1 | 15 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 15 | 1 | 15 | 15 | 0.285714 | 0.533333 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dd496b850e29935b61720d2d2a92ef44eb93a8f6 | 154 | py | Python | server/app/routes/__init__.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | server/app/routes/__init__.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | server/app/routes/__init__.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | from flask_restful import Resource
class Default(Resource):
def get(self):
return { 'data': 'Hello there! Let\'s make some great food!' } | 30.8 | 70 | 0.662338 | 21 | 154 | 4.809524 | 0.952381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.227273 | 154 | 5 | 70 | 30.8 | 0.84874 | 0 | 0 | 0 | 0 | 0 | 0.139073 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
dd920c177fea0cf84f60d0bb5f040dc124a2c9f2 | 204 | py | Python | lib/network_generator.py | learning-layers/SocialNetworkAnalysis | b9fc6ab3525558fc21d9d298c65875959547aaae | [
"Apache-2.0"
] | null | null | null | lib/network_generator.py | learning-layers/SocialNetworkAnalysis | b9fc6ab3525558fc21d9d298c65875959547aaae | [
"Apache-2.0"
] | null | null | null | lib/network_generator.py | learning-layers/SocialNetworkAnalysis | b9fc6ab3525558fc21d9d298c65875959547aaae | [
"Apache-2.0"
] | null | null | null | from graph_tool.all import *
from lib.network import Network
def get_fully_connected(filename, size=100):
return Network(filename, graph=complete_graph(size, self_loops=False, directed=False))
| 17 | 90 | 0.779412 | 29 | 204 | 5.310345 | 0.689655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016949 | 0.132353 | 204 | 11 | 91 | 18.545455 | 0.853107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 5 |
dd98a2ee2fdf37dd2ca0effcd7686d58c5e2cf91 | 124 | py | Python | test_dik_generation.py | jtauber-archive/greek-inflection | 93ae38dbdb5e93778135f9e5f229a117ed2d4041 | [
"MIT"
] | null | null | null | test_dik_generation.py | jtauber-archive/greek-inflection | 93ae38dbdb5e93778135f9e5f229a117ed2d4041 | [
"MIT"
] | null | null | null | test_dik_generation.py | jtauber-archive/greek-inflection | 93ae38dbdb5e93778135f9e5f229a117ed2d4041 | [
"MIT"
] | 1 | 2020-10-27T03:34:26.000Z | 2020-10-27T03:34:26.000Z | #!/usr/bin/env python3
from test_generation import test_generation
test_generation("tests/dik.yaml", "lexicons/dik.yaml")
| 20.666667 | 54 | 0.790323 | 18 | 124 | 5.277778 | 0.666667 | 0.442105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008772 | 0.080645 | 124 | 5 | 55 | 24.8 | 0.824561 | 0.169355 | 0 | 0 | 0 | 0 | 0.303922 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
06e78cba62f590a85608795905bb74dc85317afb | 44 | py | Python | venv/Lib/site-packages/webkit/__init__.py | eyespied/F.R.A.M.E | 5b52cd2a03bb6cd2c8dab7ba9e9e0166f35b195b | [
"MIT"
] | 1 | 2020-05-18T06:35:36.000Z | 2020-05-18T06:35:36.000Z | venv/Lib/site-packages/webkit/__init__.py | DoesArt-Studios/RamBrowse | a81da53e04d265d17e76855e7affc11130ee6120 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/webkit/__init__.py | DoesArt-Studios/RamBrowse | a81da53e04d265d17e76855e7affc11130ee6120 | [
"MIT"
] | 1 | 2020-02-20T16:29:23.000Z | 2020-02-20T16:29:23.000Z | """Pythonic toolkit for web development."""
| 22 | 43 | 0.727273 | 5 | 44 | 6.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 44 | 1 | 44 | 44 | 0.820513 | 0.840909 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
66256d89b6a79b1f201b3b6505c06dc1ad4acdc4 | 1,286 | py | Python | medium/39. Combination Sum.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | medium/39. Combination Sum.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | medium/39. Combination Sum.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | # Solution A
class Solution:
def combinationSum(self, candidates, target):
def dfs(candidates, begin, size, path, res, target):
if target < 0:
return
if target == 0:
res.append(path)
return
for index in range(begin, size):
dfs(candidates, index, size, path + [candidates[index]], res, target - candidates[index])
size = len(candidates)
if size == 0:
return []
path = []
res = []
dfs(candidates, 0, size, path, res, target)
return res
# Solution B
class Solution:
def combinationSum(self, candidates, target):
def dfs(candidates, begin, size, path, res, target):
if target == 0:
res.append(path)
return
for index in range(begin, size):
residue = target - candidates[index]
if residue < 0:
break
dfs(candidates, index, size, path + [candidates[index]], res, residue)
size = len(candidates)
if size == 0:
return []
candidates.sort()
path = []
res = []
dfs(candidates, 0, size, path, res, target)
return res
| 28.577778 | 105 | 0.497667 | 130 | 1,286 | 4.923077 | 0.2 | 0.121875 | 0.06875 | 0.10625 | 0.829688 | 0.829688 | 0.829688 | 0.735938 | 0.598438 | 0.598438 | 0 | 0.01039 | 0.401244 | 1,286 | 44 | 106 | 29.227273 | 0.820779 | 0.01633 | 0 | 0.805556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.361111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
662e6bdbaacf24230f1c14e076b7ceeeec428724 | 9,862 | py | Python | datasets/dataset.py | dreamercv/HSResNet-MMAL | e30097273b836e829ad6c60f41842e1dfc898a13 | [
"Apache-2.0"
] | 1 | 2021-09-23T07:16:29.000Z | 2021-09-23T07:16:29.000Z | datasets/dataset.py | dreamercv/HSResNet-MMAL | e30097273b836e829ad6c60f41842e1dfc898a13 | [
"Apache-2.0"
] | null | null | null | datasets/dataset.py | dreamercv/HSResNet-MMAL | e30097273b836e829ad6c60f41842e1dfc898a13 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import imageio
import os
from PIL import Image
from torchvision import transforms
import torch
import torch.utils.data as data
class CUB():
def __init__(self, input_size, root, is_train=True, data_len=None):
self.input_size = input_size
self.root = root
self.is_train = is_train
img_txt_file = open(os.path.join(self.root, 'images.txt'))
label_txt_file = open(os.path.join(self.root, 'image_class_labels.txt'))
train_val_file = open(os.path.join(self.root, 'train_test_split.txt'))
box_file = open(os.path.join(self.root, 'bounding_boxes.txt'))
img_name_list = []
for line in img_txt_file:
img_name_list.append(line[:-1].split(' ')[-1])
label_list = []
for line in label_txt_file:
label_list.append(int(line[:-1].split(' ')[-1]) - 1)
train_test_list = []
for line in train_val_file:
train_test_list.append(int(line[:-1].split(' ')[-1]))
box_file_list = []
for line in box_file:
data = line[:-1].split(' ')
box_file_list.append([int(float(data[2])), int(float(data[1])),
int(float(data[4])), int(float(data[3]))])
train_file_list = [x for i, x in zip(train_test_list, img_name_list) if i]
test_file_list = [x for i, x in zip(train_test_list, img_name_list) if not i]
self.train_box = torch.tensor([x for i, x in zip(train_test_list, box_file_list) if i])
self.test_box = torch.tensor([x for i, x in zip(train_test_list, box_file_list) if not i])
if self.is_train:
self.train_img = [os.path.join(self.root, 'images', train_file) for train_file in
train_file_list[:data_len]]
# self.train_img = [imageio.imread(os.path.join(self.root, 'images', train_file)) for train_file in
# train_file_list[:data_len]]
self.train_label = [x for i, x in zip(train_test_list, label_list) if i][:data_len]
if not self.is_train:
self.test_img = [os.path.join(self.root, 'images', test_file) for test_file in
test_file_list[:data_len]]
# self.test_img = [imageio.imread(os.path.join(self.root, 'images', test_file)) for test_file in
# test_file_list[:data_len]]
self.test_label = [x for i, x in zip(train_test_list, label_list) if not i][:data_len]
def __getitem__(self, index):
if self.is_train:
img, target, box = imageio.imread(self.train_img[index]), self.train_label[index], self.train_box[index]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
# compute scaling
height, width = img.height, img.width
height_scale = self.input_size / height
width_scale = self.input_size / width
img = transforms.Resize((self.input_size, self.input_size), Image.BILINEAR)(img)
img = transforms.RandomHorizontalFlip()(img)
img = transforms.ColorJitter(brightness=0.2, contrast=0.2)(img)
img = transforms.ToTensor()(img)
img = transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])(img)
else:
img, target, box = imageio.imread(self.test_img[index]), self.test_label[index], self.test_box[index]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
# compute scaling
height, width = img.height, img.width
height_scale = self.input_size / height
width_scale = self.input_size / width
img = transforms.Resize((self.input_size, self.input_size), Image.BILINEAR)(img)
# img = transforms.Resize((688, 688), Image.BILINEAR)(img)
# img = transforms.CenterCrop(448)(img)
img = transforms.ToTensor()(img)
img = transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])(img)
scale = torch.tensor([height_scale, width_scale])
return img, target, box, scale
def __len__(self):
if self.is_train:
return len(self.train_label)
else:
return len(self.test_label)
class STANFORD_CAR(data.Dataset):
def __init__(self, input_size, root, is_train=True, data_len=None):
self.input_size = input_size
self.root = root
self.is_train = is_train
train_img_path = os.path.join(self.root, 'cars_train')
test_img_path = os.path.join(self.root, 'cars_test')
train_label_file = open(os.path.join(self.root, 'train.txt'))
test_label_file = open(os.path.join(self.root, 'test.txt'))
train_img_label = []
test_img_label = []
for line in train_label_file:
train_img_label.append(
[os.path.join(train_img_path, line[:-1].split(' ')[0]), int(line[:-1].split(' ')[1]) - 1])
for line in test_label_file:
test_img_label.append(
[os.path.join(test_img_path, line[:-1].split(' ')[0]), int(line[:-1].split(' ')[1]) - 1])
self.train_img_label = train_img_label[:data_len]
self.test_img_label = test_img_label[:data_len]
def __getitem__(self, index):
if self.is_train:
img, target = imageio.imread(self.train_img_label[index][0]), self.train_img_label[index][1]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
normale_transform = transforms.Compose([
transforms.Resize((self.input_size, self.input_size), Image.BILINEAR),
transforms.RandomHorizontalFlip(),
transforms.ColorJitter(brightness=0.2, contrast=0.2)(img),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
img = normale_transform(img)
else:
img, target = imageio.imread(self.test_img_label[index][0]), self.test_img_label[index][1]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
img = transforms.Resize((self.input_size, self.input_size), Image.BILINEAR)(img)
# img = transforms.CenterCrop(self.input_size)(img)
img = transforms.ToTensor()(img)
img = transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])(img)
return img, target
def __len__(self):
if self.is_train:
return len(self.train_img_label)
else:
return len(self.test_img_label)
class FGVC_aircraft(data.Dataset):
def __init__(self, input_size, root, is_train=True, data_len=None, transform=None):
self.input_size = input_size
self.root = root
print("-----------------")
print(self.root)
self.is_train = is_train
self.transform = transform
self.normale_transform = transforms.Compose([
transforms.Resize((self.input_size, self.input_size), Image.BILINEAR),
transforms.RandomHorizontalFlip(),
transforms.ColorJitter(brightness=0.2, contrast=0.2),
# transforms.GaussianBlur(3),
# transforms.RandomPerspective(),
# transforms.RandomRotation((-90, 90), center=(self.input_size // 2, self.input_size // 2)),
# transforms.RandomVerticalFlip(),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
# train_img_path = os.path.join(self.root, 'data', 'images')
# test_img_path = os.path.join(self.root, 'data', 'images')
train_label_file = open(os.path.join(self.root, 'train_images.txt'), "r", encoding='utf-8')
test_label_file = open(os.path.join(self.root, 'test_images.txt'), 'r', encoding='utf-8')
train_img_label = []
test_img_label = []
for line in train_label_file.readlines():
info = line.lstrip().rstrip().split()
train_img_label.append([os.path.join(self.root, "train_images", info[0]), int(info[1]) - 1])
for line in test_label_file.readlines():
info = line.lstrip().rstrip().split()
test_img_label.append([os.path.join(self.root, "test_images", info[0]), int(info[1]) - 1])
self.train_img_label = train_img_label[:data_len]
self.test_img_label = test_img_label[:data_len]
def __getitem__(self, index):
if self.is_train:
img, target = imageio.imread(self.train_img_label[index][0]), self.train_img_label[index][1]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
if self.transform is not None:
img = self.transform(img)
img = self.normale_transform(img)
else:
img, target = imageio.imread(self.test_img_label[index][0]), self.test_img_label[index][1]
if len(img.shape) == 2:
img = np.stack([img] * 3, 2)
img = Image.fromarray(img, mode='RGB')
img = transforms.Resize((self.input_size, self.input_size), Image.BILINEAR)(img)
# img = transforms.CenterCrop(self.input_size)(img)
img = transforms.ToTensor()(img)
img = transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])(img)
return img, target
def __len__(self):
if self.is_train:
return len(self.train_img_label)
else:
return len(self.test_img_label)
| 45.447005 | 116 | 0.58984 | 1,341 | 9,862 | 4.123043 | 0.087994 | 0.047206 | 0.061132 | 0.045578 | 0.817508 | 0.814795 | 0.783143 | 0.746428 | 0.684391 | 0.650751 | 0 | 0.03179 | 0.272764 | 9,862 | 216 | 117 | 45.657407 | 0.739124 | 0.082133 | 0 | 0.549708 | 0 | 0 | 0.025125 | 0.002435 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052632 | false | 0 | 0.040936 | 0 | 0.163743 | 0.011696 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6640aa9e91e0761bcffc34eed1049fd440c99944 | 129 | py | Python | app/server/database/database.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | app/server/database/database.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | app/server/database/database.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:1147fcec5d52acf5190727e18608d1a0c95bc36eee4a487c3569d5f5307873ea
size 1941
| 32.25 | 75 | 0.883721 | 13 | 129 | 8.769231 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.398374 | 0.046512 | 129 | 3 | 76 | 43 | 0.528455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
b0bd7eeb8b47851eaf30f9b339fbb0ba4715d573 | 337 | py | Python | inquire_sql_backend/config.py | PervasiveWellbeingTech/inquire-web-backend | 0a078943701472897c288ca1f2683ed749685e92 | [
"Apache-2.0"
] | 1 | 2020-10-07T09:35:47.000Z | 2020-10-07T09:35:47.000Z | inquire_sql_backend/config.py | PervasiveWellbeingTech/inquire-web-backend | 0a078943701472897c288ca1f2683ed749685e92 | [
"Apache-2.0"
] | 1 | 2021-06-02T03:08:57.000Z | 2021-06-02T03:08:57.000Z | inquire_sql_backend/config.py | PervasiveWellbeingTech/inquire-web-backend | 0a078943701472897c288ca1f2683ed749685e92 | [
"Apache-2.0"
] | null | null | null | INQUIRE_DATA_ROOT = "/commuter/inquire_data_root"
INDEXES_DIRECTORY = "/commuter/inquire_data_root/default/indexes/"
DB_LIVEJOURNAL_STRING = "host=commuter.stanford.edu dbname=inquire_newparse user=postgres password=12344321"
DB_REDDIT_STRING = "host=commuter.stanford.edu dbname=inquire_reddit_may2015 user=postgres password=12344321" | 56.166667 | 109 | 0.851632 | 44 | 337 | 6.204545 | 0.477273 | 0.120879 | 0.164835 | 0.168498 | 0.307692 | 0.307692 | 0.307692 | 0 | 0 | 0 | 0 | 0.062893 | 0.05638 | 337 | 6 | 109 | 56.166667 | 0.795597 | 0 | 0 | 0 | 0 | 0 | 0.713018 | 0.517751 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
b0d3f911ef4f7874e259cc7a47404da71f117f75 | 59 | py | Python | nebooman/__init__.py | Zebradil/nebooman | 7bc95193d9baa2fee8d476f022b8de251c88424e | [
"MIT"
] | 1 | 2017-10-15T09:24:04.000Z | 2017-10-15T09:24:04.000Z | nebooman/__init__.py | Zebradil/nebooman | 7bc95193d9baa2fee8d476f022b8de251c88424e | [
"MIT"
] | null | null | null | nebooman/__init__.py | Zebradil/nebooman | 7bc95193d9baa2fee8d476f022b8de251c88424e | [
"MIT"
] | 2 | 2017-09-02T20:22:21.000Z | 2022-02-25T14:24:10.000Z | # vim:fileencoding=utf-8:noet
from .manager import Manager
| 19.666667 | 29 | 0.79661 | 9 | 59 | 5.222222 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0.101695 | 59 | 2 | 30 | 29.5 | 0.867925 | 0.457627 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
9fead6c957788a07dadd881f3e08935928c90d48 | 163 | py | Python | Codes/Liam/557_reverse_words_in_a_string_III.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 256 | 2017-10-25T13:02:15.000Z | 2022-02-25T13:47:59.000Z | Codes/Liam/557_reverse_words_in_a_string_III.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 56 | 2017-10-27T01:34:20.000Z | 2022-03-01T00:20:55.000Z | Codes/Liam/557_reverse_words_in_a_string_III.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 83 | 2017-10-25T12:51:53.000Z | 2022-02-15T08:27:03.000Z | # 执行用时 : 36 ms
# 内存消耗 : 14 MB
# 方案:python内置翻转字符串
class Solution:
def reverseWords(self, s: str) -> str:
return " ".join(i[::-1] for i in s.split())
| 16.3 | 51 | 0.576687 | 25 | 163 | 3.76 | 0.88 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041322 | 0.257669 | 163 | 9 | 52 | 18.111111 | 0.735537 | 0.257669 | 0 | 0 | 0 | 0 | 0.008547 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
b0085e445e0808af634a033ebdac99fe0cc875bf | 125 | py | Python | events/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | events/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | events/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Casting, Event
admin.site.register(Casting)
admin.site.register(Event)
| 20.833333 | 34 | 0.816 | 18 | 125 | 5.666667 | 0.555556 | 0.176471 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096 | 125 | 5 | 35 | 25 | 0.902655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
b02d436ab6274d99c9ccffc627e3d6a3995171fc | 191 | py | Python | TinyAutoML/Preprocessing/__init__.py | thomktz/TinyAutoML | 74d9d806ac31795dbf1c4fd60755b0bf9a7c4124 | [
"MIT"
] | null | null | null | TinyAutoML/Preprocessing/__init__.py | thomktz/TinyAutoML | 74d9d806ac31795dbf1c4fd60755b0bf9a7c4124 | [
"MIT"
] | 1 | 2022-03-07T14:22:42.000Z | 2022-03-07T14:27:38.000Z | TinyAutoML/Preprocessing/__init__.py | thomktz/TinyAutoML | 74d9d806ac31795dbf1c4fd60755b0bf9a7c4124 | [
"MIT"
] | 1 | 2022-03-07T14:18:49.000Z | 2022-03-07T14:18:49.000Z | from .LassoSelectorTransformer import LassoSelectorTransformer
from .NonStationarityCorrector import NonStationarityCorrector
__all__=['LassoSelectorTransformer', 'NonStationarityCorrector'] | 47.75 | 64 | 0.895288 | 11 | 191 | 15.181818 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052356 | 191 | 4 | 64 | 47.75 | 0.922652 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
b057c2ec4cfd000a0bff57158e15dcd04696032a | 95 | py | Python | brigadier/result_consumer.py | NickNackGus/brigadier.py | 43b315446711af3e313bdbb4b0b13a75f6f3a19e | [
"MIT"
] | null | null | null | brigadier/result_consumer.py | NickNackGus/brigadier.py | 43b315446711af3e313bdbb4b0b13a75f6f3a19e | [
"MIT"
] | 1 | 2020-11-03T00:20:41.000Z | 2020-11-04T06:16:16.000Z | brigadier/result_consumer.py | NickNackGus/brigadier.py | 43b315446711af3e313bdbb4b0b13a75f6f3a19e | [
"MIT"
] | 1 | 2020-11-02T23:55:34.000Z | 2020-11-02T23:55:34.000Z | class ResultConsumer:
def on_command_complete(self, context, success, result):
pass | 31.666667 | 60 | 0.726316 | 11 | 95 | 6.090909 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 95 | 3 | 61 | 31.666667 | 0.881579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
c6bdef79f22a3fada8d485939a9e93b8042e3f03 | 9,009 | py | Python | ssd_net_vgg.py | Aristochi/Dangerous_driving_behavior_detection | 596d0544c3ed8cbfbc322cc4cd7859a9ef539810 | [
"MIT"
] | 96 | 2020-03-14T10:17:34.000Z | 2022-03-29T03:46:35.000Z | ssd_net_vgg.py | ardorG-ai/Dangerous_driving_behavior_detection | 596d0544c3ed8cbfbc322cc4cd7859a9ef539810 | [
"MIT"
] | 6 | 2020-09-15T05:56:15.000Z | 2022-03-25T01:28:12.000Z | ssd_net_vgg.py | ardorG-ai/Dangerous_driving_behavior_detection | 596d0544c3ed8cbfbc322cc4cd7859a9ef539810 | [
"MIT"
] | 25 | 2020-04-12T11:40:27.000Z | 2022-01-24T02:56:35.000Z | import torch
import torch.nn as nn
import l2norm
import Config as config
class SSD(nn.Module):
def __init__(self):
super(SSD,self).__init__()
self.vgg = []
#vgg-16模型
self.vgg.append(nn.Conv2d(in_channels=3,out_channels=64,kernel_size=3,stride=1,padding=1))#conv1_1
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=64,out_channels=64,kernel_size=3,stride=1,padding=1))#conv1_2
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.MaxPool2d(kernel_size=2,stride=2))#maxpool1
self.vgg.append(nn.Conv2d(in_channels=64,out_channels=128,kernel_size=3,stride=1,padding=1))#conv2_1
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=128,out_channels=128,kernel_size=3,stride=1,padding=1))#conv2_2
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.MaxPool2d(kernel_size=2,stride=2))#maxpool2
self.vgg.append(nn.Conv2d(in_channels=128,out_channels=256,kernel_size=3,stride=1,padding=1))#conv3_1
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=256,out_channels=256,kernel_size=3,stride=1,padding=1))#conv3_2
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=256,out_channels=256,kernel_size=3,stride=1,padding=1))#conv3_3
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.MaxPool2d(kernel_size=2,stride=2,ceil_mode=True))#maxpool3
self.vgg.append(nn.Conv2d(in_channels=256,out_channels=512,kernel_size=3,stride=1,padding=1))#conv4_1
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=512,kernel_size=3,stride=1,padding=1))#conv4_2
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=512,kernel_size=3,stride=1,padding=1))#conv4_3
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.MaxPool2d(kernel_size=2,stride=2))#maxpool4
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=512,kernel_size=3,stride=1,padding=1))#conv5_1
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=512,kernel_size=3,stride=1,padding=1))#conv5_2
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=512,kernel_size=3,stride=1,padding=1))#conv5_3
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.MaxPool2d(kernel_size=3,stride=1,padding=1))#maxpool5
self.vgg.append(nn.Conv2d(in_channels=512,out_channels=1024,kernel_size=3,padding=6,dilation=6))#conv6
self.vgg.append(nn.ReLU(inplace=True))
self.vgg.append(nn.Conv2d(in_channels=1024,out_channels=1024,kernel_size=1))#conv7
self.vgg.append(nn.ReLU(inplace=True))
self.vgg = nn.ModuleList(self.vgg)
self.conv8_1 = nn.Sequential(
nn.Conv2d(in_channels=1024,out_channels=256,kernel_size=1),
nn.ReLU(inplace=True)
)
self.conv8_2 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=512,kernel_size=3,stride=2,padding=1),
nn.ReLU(inplace=True)
)
self.conv9_1 = nn.Sequential(
nn.Conv2d(in_channels=512,out_channels=128,kernel_size=1),
nn.ReLU(inplace=True)
)
self.conv9_2 = nn.Sequential(
nn.Conv2d(in_channels=128,out_channels=256,kernel_size=3,stride=2,padding=1),
nn.ReLU(inplace=True)
)
self.conv10_1 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=128,kernel_size=1),
nn.ReLU(inplace=True)
)
self.conv10_2 = nn.Sequential(
nn.Conv2d(in_channels=128,out_channels=256,kernel_size=3,stride=1),
nn.ReLU(inplace=True)
)
self.conv11_1 = nn.Sequential(
nn.Conv2d(in_channels=256, out_channels=128, kernel_size=1),
nn.ReLU(inplace=True)
)
self.conv11_2 = nn.Sequential(
nn.Conv2d(in_channels=128, out_channels=256, kernel_size=3, stride=1),
nn.ReLU(inplace=True)
)
#特征层位置输出
self.feature_map_loc_1 = nn.Sequential(
nn.Conv2d(in_channels=512,out_channels=4*4,kernel_size=3,stride=1,padding=1)
)
self.feature_map_loc_2 = nn.Sequential(
nn.Conv2d(in_channels=1024,out_channels=6*4,kernel_size=3,stride=1,padding=1)
)
self.feature_map_loc_3 = nn.Sequential(
nn.Conv2d(in_channels=512,out_channels=6*4,kernel_size=3,stride=1,padding=1)
)
self.feature_map_loc_4 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=6*4,kernel_size=3,stride=1,padding=1)
)
self.feature_map_loc_5 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=4*4,kernel_size=3,stride=1,padding=1)
)
self.feature_map_loc_6 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=4*4,kernel_size=3,stride=1,padding=1)
)
#特征层类别输出
self.feature_map_conf_1 = nn.Sequential(
nn.Conv2d(in_channels=512,out_channels=4*config.class_num,kernel_size=3,stride=1,padding=1)
)
self.feature_map_conf_2 = nn.Sequential(
nn.Conv2d(in_channels=1024,out_channels=6*config.class_num,kernel_size=3,stride=1,padding=1)
)
self.feature_map_conf_3 = nn.Sequential(
nn.Conv2d(in_channels=512,out_channels=6*config.class_num,kernel_size=3,stride=1,padding=1)
)
self.feature_map_conf_4 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=6*config.class_num,kernel_size=3,stride=1,padding=1)
)
self.feature_map_conf_5 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=4*config.class_num,kernel_size=3,stride=1,padding=1)
)
self.feature_map_conf_6 = nn.Sequential(
nn.Conv2d(in_channels=256,out_channels=4*config.class_num,kernel_size=3,stride=1,padding=1)
)
#正向传播过程
def forward(self, image):
out = self.vgg[0](image)
out = self.vgg[1](out)
out = self.vgg[2](out)
out = self.vgg[3](out)
out = self.vgg[4](out)
out = self.vgg[5](out)
out = self.vgg[6](out)
out = self.vgg[7](out)
out = self.vgg[8](out)
out = self.vgg[9](out)
out = self.vgg[10](out)
out = self.vgg[11](out)
out = self.vgg[12](out)
out = self.vgg[13](out)
out = self.vgg[14](out)
out = self.vgg[15](out)
out = self.vgg[16](out)
out = self.vgg[17](out)
out = self.vgg[18](out)
out = self.vgg[19](out)
out = self.vgg[20](out)
out = self.vgg[21](out)
out = self.vgg[22](out)
my_L2Norm = l2norm.L2Norm(512, 20)
feature_map_1 = out
feature_map_1 = my_L2Norm(feature_map_1)
loc_1 = self.feature_map_loc_1(feature_map_1).permute((0,2,3,1)).contiguous()
conf_1 = self.feature_map_conf_1(feature_map_1).permute((0,2,3,1)).contiguous()
out = self.vgg[23](out)
out = self.vgg[24](out)
out = self.vgg[25](out)
out = self.vgg[26](out)
out = self.vgg[27](out)
out = self.vgg[28](out)
out = self.vgg[29](out)
out = self.vgg[30](out)
out = self.vgg[31](out)
out = self.vgg[32](out)
out = self.vgg[33](out)
out = self.vgg[34](out)
feature_map_2 = out
loc_2 = self.feature_map_loc_2(feature_map_2).permute((0,2,3,1)).contiguous()
conf_2 = self.feature_map_conf_2(feature_map_2).permute((0,2,3,1)).contiguous()
out = self.conv8_1(out)
out = self.conv8_2(out)
feature_map_3 = out
loc_3 = self.feature_map_loc_3(feature_map_3).permute((0,2,3,1)).contiguous()
conf_3 = self.feature_map_conf_3(feature_map_3).permute((0,2,3,1)).contiguous()
out = self.conv9_1(out)
out = self.conv9_2(out)
feature_map_4 = out
loc_4 = self.feature_map_loc_4(feature_map_4).permute((0,2,3,1)).contiguous()
conf_4 = self.feature_map_conf_4(feature_map_4).permute((0,2,3,1)).contiguous()
out = self.conv10_1(out)
out = self.conv10_2(out)
feature_map_5 = out
loc_5 = self.feature_map_loc_5(feature_map_5).permute((0,2,3,1)).contiguous()
conf_5 = self.feature_map_conf_5(feature_map_5).permute((0,2,3,1)).contiguous()
out = self.conv11_1(out)
out = self.conv11_2(out)
feature_map_6 = out
loc_6 = self.feature_map_loc_6(feature_map_6).permute((0,2,3,1)).contiguous()
conf_6 = self.feature_map_conf_6(feature_map_6).permute((0,2,3,1)).contiguous()
loc_list = [loc_1,loc_2,loc_3,loc_4,loc_5,loc_6]
conf_list = [conf_1,conf_2,conf_3,conf_4,conf_5,conf_6]
return loc_list,conf_list
| 48.435484 | 110 | 0.645244 | 1,438 | 9,009 | 3.836579 | 0.072323 | 0.092623 | 0.065253 | 0.09516 | 0.793003 | 0.742614 | 0.742614 | 0.719775 | 0.707631 | 0.690593 | 0 | 0.084002 | 0.211122 | 9,009 | 185 | 111 | 48.697297 | 0.692275 | 0.018759 | 0 | 0.22905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.011173 | false | 0 | 0.022346 | 0 | 0.044693 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
05b61ed0f4e2a71e41e61b0dc94e1fef31704412 | 125 | py | Python | MISSIONS/bvr_sim/agent/full_assult.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | 2 | 2022-02-25T12:04:55.000Z | 2022-03-15T02:37:59.000Z | MISSIONS/bvr_sim/agent/full_assult.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | null | null | null | MISSIONS/bvr_sim/agent/full_assult.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | null | null | null | from typing import List
from agent.agent import Agent
from env.env_cmd import CmdEnv
import copy
import random
import time
| 15.625 | 31 | 0.824 | 21 | 125 | 4.857143 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 125 | 7 | 32 | 17.857143 | 0.971429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.